Question
Explain how to force the garbage collection in Java

Answers

- First of all Garbage collection is an automatic process and can't be forced. Although, you can request it by calling System.gc().
- JVM does not guarantee that GC will be started immediately.
- Every class inherits finalize() method from java.lang.Object.
- The finalize() method is called by garbage collector when it determines no more references to the object exists.
- You can sent request to recycle the unused objects by calling System.gc() and Runtime.gc() , but there is no guarantee when all the objects will garbage collected.   Your Comment




More Software,Java Questions..
What is the inputsplit in map reduce software?

Can variables be used in Java without initialization?

What is the difference between java bean and enterprise java bean?

What is software configuration management?

How does the java database connectivity (jdbc) work?

What are the advantages of threads in java?

What Is Java Api For Xml-based Rpc (jax-rpc)?

How can you implement fine-grained auditing?

What is IBM’s simple explanation for Big Data’s four critical features?

What is static synchronized method in JDBC API? Give an example?

What does the NULLIF function do?

What happens if a start method is not invoked and the run method is directly invoked?

Should we override finalize method

what is the difference between mysql_fetch_array and mysql_fetch_object?

How will XML affect my document links?

What is object cloning in Java?

Why to use Style Sheets?

What are Filters in MVC?

Can you explain Application layer in OSI model?

How to define new testplan attributes?



Search
Can you Answer!!
  • Q Which Indian social activist’s famous work is ‘My Village-My Sacred Land’ ?
  • Q Highest mountain peak of North America is?
  • Q The elapsed time between the submission of the job and getting the output is
  • Q Who founded the Greek theatre
  • Q Explain what is the surveillance process for Epidemiology?
  • Q What is culture?
  • Q Capital Market Regulator is
  • Q What criteria do you use when determining when to automate a test or leave it manual?
  • Q Explain what is blackberry? please make it clear for a layman?
  • Q Give an instance of a recent marketing brief which you developed for a recent marketing program.
  • Q There are coins of Rs.5, 2, 1,50p, 25p, 10p, 5p. each one has got a weight. Rs 5 coin weighs 20gms.find the minimum number of coins to get a total of 196.5gms.