i***@noisolation.com
2018-11-26 15:49:23 UTC
Hello!
I'm having problems using the Chromium in an embedded device, due to what
seems to be too aggressive memory consumption.
Architecture: aarch64 (armv8-a).
OS: Linux (kernel 4.9.39).
*Test situation:*
Chromium Embedded Framework (CEF; cefsimple example program) running with a
cgroup limiting memory to a max of 320MB. If I hadn't had this cgroup limit
the same happens only much later when the whole ram is spent (1GB). A
simple html+images+js webpage that uses js to switch between images in a
loop. No new content over time, just the same over and over again.
*Expected:*
Chromium to consume the size of all binaries as the memory mapped libraries
are used and loaded into ram + os process/thread overhead + webpage content
size ++.
*What actually happens:*
Chromium uses all available memory to within 1MB, not right away but it
slowly grows from half of the given max until there is nothing left, then
hugs that limit so closely that either it gets itself killed by the OOM, or
if the OOM is turned off it fails to create new threads (pthread_create)
due to those resource limits. This depends a bit on the type of content.
With the image switcher described above it grows in steps, which if graphed
look like stairs. However, if the page has a row of images and use CSS
animations to translate them back and forth the memory "leak" / usage grows
slow and steady, completely linearly, until there is nothing left and it
hugs that limit closely until it fails.
*Questions:*
1. Is there a concept of Memory Pressure for Linux? I cannot see it in
the source. I assume this is supposed to hint to Chromiums allocators to
ease off and GC when closing on the limit.
2. Why does Chromium insist on using all the memory? It is clearly more
than it needs since it spends some time getting to the max.
3. How can I make Chromium believe that it has 20-30MB less memory than
it does by patching the source? I'm thinking this may be enough to hide the
crash since it does seem to respect the limit somewhat, just not well
enough.
1. I'm hoping that when it over-steps the allocators will GC to
correct itself. Might be wrong?
2. Keeping it a bit below the limit will also prevent the kernel from
slowing the CPU to punish the process for using all its allowed memory
(high vs. max memory limits in cgroups).
4. Any other ideas for me?
I really appreciate any help or guidance you may provide me with!
I'm having problems using the Chromium in an embedded device, due to what
seems to be too aggressive memory consumption.
Architecture: aarch64 (armv8-a).
OS: Linux (kernel 4.9.39).
*Test situation:*
Chromium Embedded Framework (CEF; cefsimple example program) running with a
cgroup limiting memory to a max of 320MB. If I hadn't had this cgroup limit
the same happens only much later when the whole ram is spent (1GB). A
simple html+images+js webpage that uses js to switch between images in a
loop. No new content over time, just the same over and over again.
*Expected:*
Chromium to consume the size of all binaries as the memory mapped libraries
are used and loaded into ram + os process/thread overhead + webpage content
size ++.
*What actually happens:*
Chromium uses all available memory to within 1MB, not right away but it
slowly grows from half of the given max until there is nothing left, then
hugs that limit so closely that either it gets itself killed by the OOM, or
if the OOM is turned off it fails to create new threads (pthread_create)
due to those resource limits. This depends a bit on the type of content.
With the image switcher described above it grows in steps, which if graphed
look like stairs. However, if the page has a row of images and use CSS
animations to translate them back and forth the memory "leak" / usage grows
slow and steady, completely linearly, until there is nothing left and it
hugs that limit closely until it fails.
*Questions:*
1. Is there a concept of Memory Pressure for Linux? I cannot see it in
the source. I assume this is supposed to hint to Chromiums allocators to
ease off and GC when closing on the limit.
2. Why does Chromium insist on using all the memory? It is clearly more
than it needs since it spends some time getting to the max.
3. How can I make Chromium believe that it has 20-30MB less memory than
it does by patching the source? I'm thinking this may be enough to hide the
crash since it does seem to respect the limit somewhat, just not well
enough.
1. I'm hoping that when it over-steps the allocators will GC to
correct itself. Might be wrong?
2. Keeping it a bit below the limit will also prevent the kernel from
slowing the CPU to punish the process for using all its allowed memory
(high vs. max memory limits in cgroups).
4. Any other ideas for me?
I really appreciate any help or guidance you may provide me with!
--
--
Chromium Developers mailing list: chromium-***@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+***@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/f47a75f4-2b4e-43c7-9540-7b02dcd882d0%40chromium.org.
--
Chromium Developers mailing list: chromium-***@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+***@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/f47a75f4-2b4e-43c7-9540-7b02dcd882d0%40chromium.org.