[TIMOB-25075] Android. v8 LowMemoryNotification
GitHub Issue | n/a |
Type | Improvement |
Priority | Critical |
Status | Closed |
Resolution | Duplicate |
Resolution Date | 2018-08-02T09:56:12.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Android |
Labels | android, memory, v8 |
Reporter | Sergey Volkov |
Assignee | Unknown |
Created | 2017-08-07T12:39:08.000+0000 |
Updated | 2018-08-06T17:41:12.000+0000 |
Description
v8 supports optional notification "LowMemoryNotification". Call to this method causes proper garbage collection, so many object will be collected on both js and java sides.
In my experience "IdleNotificationDeadline(now+0.1)" is not enough to collect all objects and some times this could lead to huge memory leak (actually it is not leak, because memory in java heap will be freed after gc in v8, for example if I call js heap snapshot creation)
I suggest, that we should add "LowMemoryNotification" call in case of:
- Application.onLowMemory
- Application.onTrimMemory
Also maybe:
- in case OutOfMemoryError in classes, which already handles this exception
- preventive check free heap size (Runtime.getRuntime().freeMemory()) and call when it is low.
Attachments
In TIMOB-26242 implemented call "LowMemoryNotification". This issue could be closed.
Thanks for your ongoing eagle-eyes! Resolving as
Duplicate
.Closing as a duplicate. If this is in error, please reopen.