On Thu, 21 May 2026 13:40:22 GMT, Thomas Stuefe <[email protected]> wrote:

>There is also a question of interface cutting: seems weird to have an API for 
>resident region iteration in os:: instead of just an API that, given a range, 
>returns size of residency. After all, this is what the sole user in NMT does. 
>Might as well do that iteration down in os scope.

I agree that would feel much nicer.

>But thats for a future RFE. Question, what happens if we have multiple 
>disjunct resident regions in a stack?

I think that if there are multiple disjunct resident parts we eventually 
account for all of them. `SnapshotThreadStackWalker` ends up calling 
`first_resident_in_range` multiple times in a loop until it has processed the 
entire `VirtualMemoryRegion`. 

In a future improvement it probably makes sense to wrap this all in a function 
like you suggest: `resident_in_range` which walks an entire given region 
summing up all the potentially disjunct resident portions.

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

PR Comment: https://git.openjdk.org/jdk/pull/31124#issuecomment-4510918101

Reply via email to