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

Many plants grown in Hawaii cannot be grown in the United States because of _____. competitive factors physical factors geographic features photosynthetic feat
All types of precipitation are formed through A. insolation. B. sublimation. C. transpiration. D. condensation.
Write a recursive formula for the arithmetic sequence below. What is the value of the 8th term? 1, 5, 9, 13, . . .
what is 98% more then 1170
Evaluate the expression: 6 / 2 ( 1 + 2) = ?
Napoleon conquered and added to his empire, he established what type of government.
Selling indulgences was a way for the pope to raise money. a. True b. False
Electrons in an excited state are more likely to enter into chemical reactions. a. true b. false
Which lines in the poem express the view that death is an enviable state that frees the departed from the miseries of the body and old age? Farewell, thou chil
Why is Colombian exchange so important