Solved

asyncronous gc

Posted on 2002-06-06
4
188 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
scoresSpecial  challenge 13 42
array6 challenfge 6 64
eclipse compiler vs Installed JREs option 3 40
Java Timer (static) 9 16
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This video teaches viewers about errors in exception handling.

760 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

21 Experts available now in Live!

Get 1:1 Help Now