Deallocating memory pages
yamauchi at google.com
Tue Feb 12 01:20:28 UTC 2013
> We talked about it some. I think the main question is what happens
> in a situation that is tight on physical memory.
> What happens when a page is deallocated
> in this way with madvise and then the page is touched again and all
> the physical memory on the system is in use? Does the system just
> start paging? Have you seen this happen?
Yes, it will just start paging. When a page is reallocated after being
deallocated by madvise(MADV_DONTNEED), it is no different from a
normal page allocation. That is, if there is no physical memory left
on the system at that point, the system will page out some other pages
to make room, just like when the system is out of physical memory in
general. I confirmed this by asking around and running a small test.
> The main impediment for moving forward on this is that we
> would need to implement this on other platforms and generally
> people don't have any spare time at this point
> in the JDK 8 schedule.
> No one objected to the concept. Just some concerns about
> possible unexpected behavior on other platforms. And who
> could do the work.
I am not familiar with how you guys generally approach this sort of
platform-specific features: Is it an option to have this as a
platform-specific feature first and add the support for other
platforms as we go? Or, it is not a good idea to have it at all until
it supports all platforms at once?
On a related note, was there an (at least initially) platform-specific
feature/patch that was contributed and extended later to all platforms
(or left platform-specific) in the past? How was it handled, if any?
More information about the hotspot-gc-dev