Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25075] Android. v8 LowMemoryNotification

GitHub Issuen/a
TypeImprovement
PriorityCritical
StatusClosed
ResolutionDuplicate
Resolution Date2018-08-02T09:56:12.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsandroid, memory, v8
ReporterSergey Volkov
AssigneeUnknown
Created2017-08-07T12:39:08.000+0000
Updated2018-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

FileDateSize
0001-v8-LowMemoryNotification.patch2017-08-07T12:13:05.000+00004913

Comments

  1. Sergey Volkov 2018-08-02

    In TIMOB-26242 implemented call "LowMemoryNotification". This issue could be closed.
  2. Hans Knöchel 2018-08-02

    Thanks for your ongoing eagle-eyes! Resolving as Duplicate.
  3. Eric Merriman 2018-08-06

    Closing as a duplicate. If this is in error, please reopen.

JSON Source