Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How to send a request to garbage collector?

Answer Posted / ashwani maddeshiya

static void gc() // Requests GC to run
static void runFinalization() // Requests finalizers to run

OR
mport java.util.*;

class GarbageCollectionDemo
{
public static void main(String s[]) throws Exception
{
// Get runtime environment
Runtime rt = Runtime.getRuntime();
System.out.println("Free memory before Garbage Collection = "+rt.freeMemory());

// Apply garbage collection
rt.gc();
System.out.println("Free memory after Garbage Collection = "+rt.freeMemory());
}
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are measurable parameters?

1075


Difference between ‘>>’ and ‘>>>’ operators in java?

1122


Why we used break and continue statement in java?

1141


what invokes a threads run() method? : Java thread

1014


What is sizeof in java?

1105


Is passing by reference faster?

988


What is the generic function?

984


How to make a write-only class in java?

1057


design an lru cache in java?

1004


How many tetrahedral voids are there in bcc?

1094


What is java in simple terms?

999


Is age a discrete variable?

972


What is JDBC Driver interface?How can you retrieve data from the ResultSet

2107


What is a conditional statement explain with example?

1014


What is indexof?

979