GARBAGE Collection

xiaoxiao2021-03-06  48

l Garbage Collection:

l Let the object "Have the opportunity" by Garbage Collected method:

n nulling a reasonnce

n reasonear a reason value Value

n isolating a reference

l gc runs in low memory. VM set this Thread's priority to 0 (minimum).

l When the system has other THREADs, GC will not be performed.

l Only GC can deStroy an Object.

l runtime.getRuntime (). GC () / system.gc ()

l Finaliaze is a call to truly GC.

l The finalize method of each instance can only Run ONCE

l string s = "hello"; string s = Nothing; è is not garbage collected

String s = new string ("hello"); string s = nothing; è is Garbage Collected

From: [Garfield's SCJP Read Note]

转载请注明原文地址:https://www.9cbs.com/read-110386.html

New Post(0)