Deallocating memory pages
vitalyd at gmail.com
Fri Jan 25 23:29:00 UTC 2013
I'll second your explanation for #1 - we also have some server workloads
Since the kernel will page out memory if need arises on its own, the main
benefit I'm seeing in your patch is that it removes the possibility that
kernel will page out the wrong pages. That is, if it's using LRU page
replacement (or whatever the latest heuristic might be) and GC just freed
up those pages (but ended up marking them dirty in the process), then if
kernel needs to swap out it may overlook these pages because they don't fit
the replacement policy(I guess it also ensures that these pages don't need
swap backing either). Otherwise, if the server app has not been using those
extra pages for a while anyway, I'm thinking kernel will pick up on that.
Is that right? Just want to make sure I understand.
Sent from my phone
On Jan 25, 2013 6:13 PM, "Hiroshi Yamauchi" <yamauchi at google.com> wrote:
> Hi Jon,
> I haven't talked to you for a while. I hope you are doing well :)
> This is a nice feature but I'm asking myself what type
>> of applications would see significant footprint reductions.
>> Would they be
>> 1) applications whose heap usage varies significantly
>> over time so that there are periods when some large
>> fraction of the heap is unused and
> Yes. Especially multiple applications with workload variations running on
> a (shared) machine. Under this sort of environment, it seems to make things
> work more nicely as a whole from a machine/memory resource utilization
> point of view because it's not uncommon (in my opinion) to see some
> applications happen to be currently running with higher workload and
> needing more RAM while others happen to be currently running with lower
> workload and needing less RAM at a point in time in a shared machine.
> In server applications, this sort of workload variations can happen for
> reasons such as capacity redundancy and time-of-day variations, etc. On
> desktops, one might keep open all sorts of applications at the same time
> such as web browsers, developer tools, graphics tools, etc. but might put
> significant workload (or a temporary memory usage increase) on only one
> application at a time. In such an environment, if an application that was
> running with high workload in the past can release some RAM, it'd be much
> nicer for other applications.
>> 2) applications with many objects larger than a page so that freeing
>> those objects could free memory.
> Yes, but objects don't necessarily have to be larger than a page as long
> as free chunks that are left after they are freed get coalesced together
> into a free chunk that's larger than a page.
>> Is that a good guess or is it more general than that?
> I hope the above makes sense. I can discuss more if desired.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the hotspot-gc-dev