chessacs9827 chessacs9827
  • 17-07-2019
  • Computers and Technology
contestada

I am making a java application, and I need to forcethe garbage collection, how can I

achieve that, if not why?

Respuesta :

mominetti
mominetti mominetti
  • 22-07-2019

Answer:

Hi!

  1. Runtime objectRuntime = Runtime.getRuntime();
  2. objectRuntime.gc();

Explanation:

First, you have to create an instance of a Java Runtime object. (see the first step of the answer).

Then, after creating the instance of Runtime object you have to invoke gc() method of the Runtime class. (see the second step of the answer).

Answer Link

Otras preguntas

Which is an example of a adjectival phrase in the sentence "Ricardo felt great sadness for his little sister, whose big, brown eyes leaked with tears after she
Please help fast this is due pretty soon and I have to go somewhere any explanation or answer would be great
HELP MEEEE ASAP PLSSSSSS
How did Dr. Rush impact Philadelphians during the yellow fever epidemic?
What is the solution to the inequality shown? -2(x + 3) < 6 - x x > -12 x < -12 x > 12 x < 12
How were free African American communities able to assist poor African Americans in the mid-19th century?
can someone help me with this? all of the info is in the pic
what is something I learned- 7th grade acc science there is an ATTACHMENT
A large box of biscuit mix costs $6.48. The box contains 72 servings of biscuit mix. One serving is equal to ¼ cup of biscuit mix. This table shows the amount o
What is the missing fraction of 5/6?