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

what are the most common reasons for mispronunciation?
One of the of sulfur is represented as sulfur-35 or S- 35. What does the number 35 signify?
What is a Tzotchke? please help
What are the advantages and disadvantages of vo2 max
what percentage of the energy flowing through primary producers is ultimately transferred to secondary consumers?
The spread of the factory system resulted in all of the following EXCEPT: a. the movement away from home production. b. poorer quality of iron. c. the need for
what number is 1,999,999 less than the smallest 10-digit number?
In some of these sentences one word has been spelt wrongly. Underline the word and write its correct spelling in the space provided.1. The dairy near our house
What is the total number of orbitals containing only one electron in an atom of nitrogen in the ground state? 1 2 3 4
which option of ms-word is used o represent data in an organised manner?