Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

asyncronous gc

Posted on 2002-06-06
4
Medium Priority
?
208 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 1200 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
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 will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

972 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