On Fri, 10 Jul 2026 19:14:02 GMT, Kevin Walls <[email protected]> wrote:

>> Currently we still link the jvm lib on Windows with psapi.
>> But this seems to be unnecessary these days.
>> If we want to use the older API, we can compile with -DPSAPI_VERSION=1 and 
>> link psapi; but this is not done for hotspot.
>> (btw it's done for some jdk libs :
>> 
>> https://github.com/openjdk/jdk/blob/6e5bfcc6450512b4b974ed4afa067547552a0847/make/modules/jdk.attach/Lib.gmk#L35
>> https://github.com/openjdk/jdk/blob/6e5bfcc6450512b4b974ed4afa067547552a0847/make/modules/jdk.management/Lib.gmk#L35
>> 
>> but not in the hotspot build).
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Agreed it needs some care, but it looks promising.  
> The makefile comments use GetProcessMemoryInfo as a relevant function with a 
> compatibility concern.
> 
> In 
> https://learn.microsoft.com/en-us/windows/win32/api/psapi/nf-psapi-getprocessmemoryinfo
>  we still call the same K32GetProcessMemoryInfo, but the route there is 
> different.  The old PSAPI_VERSION=1 route is via GetProcessMemoryInfo in 
> psapi.dll which calls K32GetProcessMemoryInfo.  As I read it we may avoid 
> some indirection by making this change, and it should not be different 
> information.

@kevinjwalls , @tstuefe can you do a review?

-------------

PR Comment: https://git.openjdk.org/jdk/pull/31846#issuecomment-4981224065

Reply via email to