Your CC list suggests that this is intended for ChromeOS. In that
case, you can patch the kernel to do this in a cleaner fashion:
http://lwn.net/Articles/267013/
Cheers
AGL
To elaborate, for non-ChromeOS Chrome I believe we don't have the
privileges to adjust our oom scores anyway.
The current strategy is to keep users out of memory management, by
killing renderers and reloading tabs quasi-transparently.
>
> To do this, I have the following approach in mind:
> - Browser process forks a dummy Chrome process(which does nothing but stay idle) with --type=oom. This will have a high oom_adj score(say x) and lowmemorykiller's minfree parameter can be configured with a value little higher(say y) for a score of x. y bytes is the situation when the preventive measures can be taken.
> - When system's free memory reaches y bytes, dummy process will get killed first and Browser's SIGCHLD handler can invoke the preventive steps.
> - The dummy process can be re-spawned after it is killed.
It's a clever idea, but there are probably other ways to detect
almost-out-of-memory situations without getting the OOM killer
involved, for instance by poling /proc/meminfo. If there is no good
way, we should change the kernel so it provides one.
>
> I can put up a patch if this approach is agreeable to the community.
>
> Regards,
> Amruth Raj.
>
> --
> Chromium OS Developers mailing list: chromiu...@chromium.org
> View archives, change email options, or unsubscribe:
> http://groups.google.com/a/chromium.org/group/chromium-os-dev?hl=en
Sorry, I thought you were referring to Chrome OS only. For the other
systems, this approach is confusing. You open a large image in
Photoshop, and Chrome wakes up and suggests you kill one of its tabs?
> On Wed, Sep 7, 2011 at 9:01 PM, Evan Martin <ev...@chromium.org> wrote:
>>
>> On Wed, Sep 7, 2011 at 5:07 AM, Adam Langley <a...@chromium.org> wrote:
>> > On Wed, Sep 7, 2011 at 7:11 AM, Amruth Raj Padmanabhuni
>> > <ckq...@motorola.com> wrote:
>> >> Hi,
>> >> In an OOM situation, renderer processes in Chromium are terminated
>> >> based on
>> >> oom_adj/oom_score_adj values.
>> >
>> > Your CC list suggests that this is intended for ChromeOS. In that
>> > case, you can patch the kernel to do this in a cleaner fashion:
>> > http://lwn.net/Articles/267013/
>>
>> To elaborate, for non-ChromeOS Chrome I believe we don't have the
>> privileges to adjust our oom scores anyway.
>>
>> See e.g.
>> http://codesearch.google.com/codesearch#OAMlx_jo-ck/src/chrome/browser/oom_priority_manager.cc&type=cs&l=22
>
> Hi,The current strategy is to keep users out of memory management, by
> In an OOM situation, renderer processes in Chromium are terminated based on oom_adj/oom_score_adj values.
> Some preventive measures can be taken before reaching this state, for example, by using MemoryPurger::Purge() to free some memory, showing a dialog to the user to close a tab etc. But these have to be done at a state which is ahead of an out-of-memory situation.
killing renderers and reloading tabs quasi-transparently.
It's a clever idea, but there are probably other ways to detect
>
> To do this, I have the following approach in mind:
> - Browser process forks a dummy Chrome process(which does nothing but stay idle) with --type=oom. This will have a high oom_adj score(say x) and lowmemorykiller's minfree parameter can be configured with a value little higher(say y) for a score of x. y bytes is the situation when the preventive measures can be taken.
> - When system's free memory reaches y bytes, dummy process will get killed first and Browser's SIGCHLD handler can invoke the preventive steps.
> - The dummy process can be re-spawned after it is killed.
almost-out-of-memory situations without getting the OOM killer
involved, for instance by poling /proc/meminfo. If there is no good
way, we should change the kernel so it provides one.
> --
> Chromium Developers mailing list: chromi...@chromium.org
> View archives, change email options, or unsubscribe:
> http://groups.google.com/a/chromium.org/group/chromium-dev
>
I thought we did in ZygoteHost::AdjustRendererOOMScore. However, my
sandboxed renderers all have oom_adj = 0, so I wonder if that code is
broken.
On a related note, I see the OOM score range is [0,1000] instead of
[0,15]. Are we using the CrOS OOM score range on Linux as well, or did
Linux change its OOM score range?
On a related note, I see the OOM score range is [0,1000] instead of
[0,15]. Are we using the CrOS OOM score range on Linux as well, or did
Linux change its OOM score range?
On a related note, I see the OOM score range is [0,1000] instead of
[0,15]. Are we using the CrOS OOM score range on Linux as well, or did
Linux change its OOM score range?
The code to allow Chrome to adjust its oom score went upstream (2.6.38):
https://github.com/torvalds/linux/commit/dabb16f639820267b3850d804571c70bd93d4e07
Should be possible to modify Chrome to test whether the feature works and then
to use it if it does.
> --
> Chromium OS Developers mailing list: chromiu...@chromium.org
> View archives, change email options, or unsubscribe:
> http://groups.google.com/a/chromium.org/group/chromium-os-dev?hl=en
Bringing up an old thread; I've been looking through the variousdocuments on how OOM is being handled and I haven't found any
documents or extension APIs which allow a web application to hook into
the OOM imposed death sequence, which could then allow the application
to be loaded back to the state the user left it.
Is the right approach for an application to watch for when it is no
longer in focus (via chrome.windows onFocusChanged?) and then persist
its internal state so it can be "safely" killed if needed, and
subsequently resume its state when re-launched?
Short of trying to manage its own state internally, is there a way an
application can know if it is being loaded as part of the quasi-
transparent reload?