For example, I have such a code
... get some memory and lose all pointers to that memory to System.gc (); can collect it.
call System.gc ();
perform some other tasks;
Here, "perform some other tasks" is performed; and "System.gc ();" works in parallel or performs "other tasks"; waiting for "System.gc ();" for execution
thank
JVM. spec ( , JVM), , , , .
JVM, , , . , . "-" ( ).
, @Chris Dail, System.gc(). Calling System.gc() . , , . , "-" , " " , . ( , , JVM , ).
, , OutOfMemoryError. JVM OutOfMemoryError, , . Calling System.gc . OutOfMemoryError, , , , , , .
, System.gc(). , C/++ Java, , , . , , , . System.gc() .
System.gc(), "" . , . , . , . , , , .
, .
, , JVM , .
, -verbosegc.
-verbosegc
- , JVM - , System.gc() - , , , .
System.gc()
JVM. , , , . Sun , .
Eric Eijkelenboom , , . , ...
( Amarghosh), , -, ? . , , .
" " System.gc() .
. System.gc() , , . JVM .
javadoc http://java.sun.com/j2se/1.4.2/docs/api/java/lang/System.html#gc(): " , Java , ".
, , " "; "System.gc();" !
parallelism - Java-. , / . - ...
Bye, Alban.
Java , System.gc(), , GC . , , JVM , Sun JVM (-XX:-DisableExplicitGC). System.gc() .
-XX:-DisableExplicitGC
. GC; Sun JVM , .
As pointed out by others, a pure call effect System.gc()obviously in most cases leads to a decrease in performance. If you feel that you should call this method, chances are you are doing something wrong.
Source: https://habr.com/ru/post/1741767/More articles:Do I need to translate (locally) to the sql server connection string? - sql-serverПередача имени столбца вместо индекса в sqlite3 - sqlitehttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1741764/how-useful-are-design-patterns-when-it-comes-to-web-programming&usg=ALkJrhgTk5bKMbAWecxFQAGuJeIV0SspawHow can I create and parse a url url / uri / path in Perl? - httpSystem.XML или Regex.Replace? - c#SQL Server 2005: Subquery in EXEC? - sql-serverNHibernate mapping for subclasses and merged subclasses - nhibernateI need to simulate my Javascript application - modelingIncludes a C header that declares a variable called "new"? - c ++Using FTP from PHP CURL - phpAll Articles