Solved

asyncronous gc

Posted on 2002-06-06
4
191 Views
Last Modified: 2010-03-31
Hi All,

I was using the -asyncgc option in jdk1.1.6 to issue the asynchronous garbage collection.
But now, i beleive that, the option is not there in higher versions of the jdk.

So, what should i do to have  the asychronous garbage collection??????
0
Comment
Question by:kulsmadya
  • 2
  • 2
4 Comments
 
LVL 9

Accepted Solution

by:
Ovi earned 300 total points
ID: 7061150
This is the documentation of the native method gc() from Runtime class. (As you probably know in the System.gc() method, there is only a call to this one Runtime.getRuntime().gc();)
    /**
     * Runs the garbage collector.
     * Calling this method suggests that the Java virtual machine expend
     * effort toward recycling unused objects in order to make the memory
     * they currently occupy available for quick reuse. When control
     * returns from the method call, the virtual machine has made
     * its best effort to recycle all discarded objects.
     * <p>
     * The name <code>gc</code> stands for "garbage
     * collector". The virtual machine performs this recycling
     * process automatically as needed, <b>IN A SEPARATE THREAD</b>, even if the
     * <code>gc</code> method is not invoked explicitly.
     * <p>
     * The method {@link System#gc()} is the conventional and convenient
     * means of invoking this method.
     */

    public native void gc();
0
 
LVL 7

Expert Comment

by:yoren
ID: 7061192
Automatic garbage collection is always asynchronous now.
0
 
LVL 9

Expert Comment

by:Ovi
ID: 7061258
From my above comment : "The virtual machine performs this recycling process automatically as needed, <b>IN A SEPARATE THREAD</b>".

A separated thread means asynchronus in this case.
0
 
LVL 7

Expert Comment

by:yoren
ID: 7061264
I agree. Ovi answered correctly first and deserves the points.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
starter POM and spring-boot-starter,  spring-boot-web 2 43
simple java question 3 44
reverse digits of a number using for loop 5 36
servlet filter example 37 43
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now