> On windows, our available_memory calculation excludes resident file cache 
> memory. The ullAvailPhys we used before is the sum of the size of the 
> standby, free, and zero lists (cf. 
> https://learn.microsoft.com/en-us/windows/win32/api/sysinfoapi/ns-sysinfoapi-memorystatusex).
>  This excludes resident file cache memory which will be made available if we 
> ask for it.
> 
> This lack of accuracy can be quite substantial and causes AHS with ZGC to OOM 
> prematurely because it thinks we are out of memory when actually there is 
> plenty available when we prune file caches.
> 
> This patch improves the accuracy by querying the appropriate windows perf 
> counter for the resident cache size. It's using the English counter name to 
> make sure it works across locales. There is a configurable hard limit though 
> that can prevent it from being prunable and the calculation takes that into 
> account.
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

Erik Österlund has updated the pull request incrementally with one additional 
commit since the last revision:

  Markus comments

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/33895/files
  - new: https://git.openjdk.org/jdk/pull/33895/files/8f430842..5b506d65

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=33895&range=07
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=33895&range=06-07

  Stats: 7 lines in 1 file changed: 5 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/33895.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/33895/head:pull/33895

PR: https://git.openjdk.org/jdk/pull/33895

Reply via email to