MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / gc

Method gc

vm/JavaAPI/src/java/lang/System.java:136–148  ·  view source on GitHub ↗

Runs the garbage collector. Calling the gc method suggests that the Java Virtual Machine expend effort toward recycling unused objects in order to make the memory they currently occupy available for quick reuse. When control returns from the method call, the Java Virtual Machine has made a best effo

()

Source from the content-addressed store, hash-verified

134 * Runtime.getRuntime().gc()
135 */
136 public static void gc() {
137 if(startedGc) {
138 forceGc = true;
139 gcShouldLoop = true;
140 }
141 startGCThread();
142 synchronized(LOCK) {
143 LOCK.notify();
144 }
145 try {
146 Thread.sleep(2);
147 } catch(InterruptedException er) {}
148 }
149
150 private native static void gcLight();
151 private native static void gcMarkSweep();

Callers 4

createImageMethod · 0.95
gcMethod · 0.95
invokeStatic14Method · 0.45
invoke43Method · 0.45

Calls 3

startGCThreadMethod · 0.95
sleepMethod · 0.95
notifyMethod · 0.45

Tested by

no test coverage detected