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

How many symphonies did Brahms write? a. Seven b. Six c. Nine d. Four
16= -5+z/4 a. 69 b. -1 c. 9 d. 59
Enzymes the activation energy threshold required to start a chemical reaction. Lower raise
Which word suggests promise? A. auspicious B. ostentation C. refutable D. retrospect
Which of these is likely to result in the most competition? a. organisms that live in different ecosystems b. organisms that use the same resource c. organisms
The Hamilton Brush Company issued 2,500 shares of common stock worth $100,000.00 total. What is the par value of each share? A. $40.00 B. $250.00 C. $400.00 D.
compare Hindu and Buddhist beliefs about reincarnation and how one should live.
what multiplys to be 12 but adds to be 7
14) Which of these is a role of Congress?
show a number line to show that 5/8 is greater than 3\8