Re: large memory allocations / resource consumption in crashtests?

2015-08-20 Thread Karl Tomlinson
On Mon, 27 Jul 2015 21:35:20 +1200, Karl Tomlinson wrote:

 Sometimes it would be nice to check in crashtests that use, or
 attempt to use large memory allocations, but I'm concerned that
 checking in these crashtests could disrupt subsequent tests
 because there is then not enough memory to test what they want to
 test.

Following up here, mainly just to report back on findings, for
anyone considering the same in the future.

I ended up backing out the test that I wanted to add [1] and I
think the main blocker is that at least some platforms overcommit
memory.  Large allocations can succeed, but the lack of memory is
not detected until the memory is actually used.  When the memory
is used, a process is killed, and AFAIK there is no guarantee that
it is the process using the new memory.

Even if we configured platforms to not overcommit, I'd still be
uncomfortable adding a test that may force everything to swap to
disk.

It seems that fallible memory allocation is only a complete
solution when constrained by address space, but perhaps we could
run our tests with process data segment size constraints tuned
for the hardware environment.

The dummy unload event listener is helpful to avoid keeping things
alive in BF cache, but AFAIK SimpleTest.forceGC/CC() (or similar
DOMWindowUtils methods) and carefully removing all references is
the only way to ensure that memory is released immediately.

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=999376#c12
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: large memory allocations / resource consumption in crashtests?

2015-07-27 Thread smaug

On 07/27/2015 04:07 PM, Ehsan Akhgari wrote:

On 2015-07-27 5:35 AM, Karl Tomlinson wrote:

Is anything done between crashtests to clean up memory use?


There isn't, AFAIK.


Or can CC be triggered to run during or after a particular crashtest?


You can use SimpleTest.forceGC/CC() as needed.


Do crashtests go into B/F cache on completion, or can we know that
nsGlobalWindow::CleanUp() or FreeInnerObjects() will run on completion?


I'm pretty sure that pages are put into the bf cache if possible as usual.




And you can test that by using pagehide event listener and check .persisted 
property.
If you explicitly want to prevent bfcache for certain page, just add a dummy 
unload event listener.
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: large memory allocations / resource consumption in crashtests?

2015-07-27 Thread Karl Tomlinson
Thanks everyone.  That gives me some ideas on how to clean up
after the page.  I figure that then any OOM issues will at least
be in the vicinity of the test doing the large allocation.
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


large memory allocations / resource consumption in crashtests?

2015-07-27 Thread Karl Tomlinson
Sometimes it would be nice to check in crashtests that use, or
attempt to use large memory allocations, but I'm concerned that
checking in these crashtests could disrupt subsequent tests
because there is then not enough memory to test what they want to
test.

Is anything done between crashtests to clean up memory use?
Or can CC be triggered to run during or after a particular crashtest?

Do crashtests go into B/F cache on completion, or can we know that
nsGlobalWindow::CleanUp() or FreeInnerObjects() will run on completion?
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform