os::committed_in_range
- on linux and (sinceJDK-8332362) macos, it returns live memory
- on windows, it returns committed memory
- on AIX, it returns the full range
The intended behavior (since its mainly used for NMT thread stacks) is to return live memory.
The Windows issue is caused by evaluating MEM_COMMIT instead of MEM_MAPPED. Switching to MEM_MAPPED may solve the problem.
The AIX issue stems from the fact that mincore(2) does not work correctly on AIX if the underlying memory was not mmaped. The AIX issue cannot easily be solved, at least not for the intended use of measuring live memory in thread stacks.
In addition, committed_in_range is a misleading name. Something like "live_in_range" would be more correct.
- on linux and (since
- on windows, it returns committed memory
- on AIX, it returns the full range
The intended behavior (since its mainly used for NMT thread stacks) is to return live memory.
The Windows issue is caused by evaluating MEM_COMMIT instead of MEM_MAPPED. Switching to MEM_MAPPED may solve the problem.
The AIX issue stems from the fact that mincore(2) does not work correctly on AIX if the underlying memory was not mmaped. The AIX issue cannot easily be solved, at least not for the intended use of measuring live memory in thread stacks.
In addition, committed_in_range is a misleading name. Something like "live_in_range" would be more correct.