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

Because Canada is a Constitutional Monarchy, its symbolic head of state is A) the Chief Justice of Canada. B) the Prime Minister of Canada. C) Queen Elizabeth
What is one of the risk factors that influences a person’s ability to abstain from sexual intercourse?
what is one intothirds -4/5
Emma,brandy,and Damian will cut a rope that is 29.8 feet long into 3 jump ropes. Each of the 3 ropes will be the same length.Write a division sentence using com
Review the terms. boisterous and obnoxious Which best identifies the relationship between these terms and explains how it influences their meaning? They are syn
Which expression is equivalent to pi*-80
True or False = A strand of DNA in a mouse contains the same base as the DNA of an octopus?
What should a photographer use with a tripod if the ground is slippery or uneven? A. aerial masts B. anti-shake heads C. anti-slip rubber feet D. leg extensions
which process takes place last in the development of a human being?
Can you help? Please