MemoryLeakUtil provides some useful methods for detecting memory leaks.
- Author
- lizlo.nosp@m.oney.nosp@m.@goog.nosp@m.le.c.nosp@m.om (Liz Looney)
Definition at line 23 of file MemoryLeakUtil.java.
◆ checkAllTrackedObjects()
static void com.google.appinventor.components.runtime.util.MemoryLeakUtil.checkAllTrackedObjects |
( |
boolean |
verbose, |
|
|
boolean |
stopTrackingCollectedObjects |
|
) |
| |
|
static |
Checks whether all tracked objects have been garbage collected, logging summary information including how many have been collected and how many have not. Optionally, it can log details showing which objects have been garbage collected and which have not.
- Parameters
-
verbose | whether to log details about each tracked object |
stopTrackingCollectedObjects | whether to stop tracking objects that have been garbage collected |
Definition at line 82 of file MemoryLeakUtil.java.
◆ isTrackedObjectCollected()
static boolean com.google.appinventor.components.runtime.util.MemoryLeakUtil.isTrackedObjectCollected |
( |
String |
key, |
|
|
boolean |
stopTrackingIfCollected |
|
) |
| |
|
static |
Checks whether a particular tracked object has been garbage collected.
- Parameters
-
key | a key returned from trackObject |
stopTrackingIfCollected | whether to stop tracking the object if it has been garbage collected |
- Returns
- true if the tracked object has been collected; false otherwise
- Exceptions
-
IllegalArgumentException | if the key is not valid |
Definition at line 57 of file MemoryLeakUtil.java.
◆ trackObject()
static String com.google.appinventor.components.runtime.util.MemoryLeakUtil.trackObject |
( |
String |
tag, |
|
|
Object |
object |
|
) |
| |
|
static |
Tracks the given Object by saving a WeakReference to it so that we can check later if it has been garbage collected.
- Parameters
-
tag | the tag for the Object |
object | the Object to track |
- Returns
- the key that is used to track the Object
Definition at line 40 of file MemoryLeakUtil.java.
The documentation for this class was generated from the following file:
- C:/Users/Ulli/appinventor-sources/appinventor/components/src/com/google/appinventor/components/runtime/util/MemoryLeakUtil.java