Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-22-2008, 02:28 PM
Member
 
Join Date: Jul 2008
Posts: 3
Rep Power: 0
RadhaJayalakshmi is on a distinguished road
Thumbs up Garbage collector and its impacts
Hi everybody,
I have a basic doubt regarding garbage collector. i am aware that garbage collector will sweep all the unreferenced references(pointing to null) when it runs. Also i have heard that nobody can predict when the garbage collector will run.. In my project i have so many unreferenced variables. What i think is, when the amount of unreferenced variables in my application increases to a huge size, garbage collector will start to run and sweep all the unreferenced variables. but because of this, will there by any slowness in the application? I perceive that when the garbage collector runs, all applications tends to slow down.. correct me if my perception is wrong!!
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 07-23-2008, 12:56 PM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,536
Rep Power: 11
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Default
Garbage collector is fully under control with JVM, so it decide when to run it. But within a program you can ask JVM to run the garbage collector too. But in that case there is no guarantee that JVM can do it.

Basically JVM sense that on what time garbage collector should run, basically at the time JVM find running on low memory.

Running of garbage collector not caused for system slowness. So you can call it any time.

Best thing is, as much as possible, use less number of reference. And also remove them if you find they are no longer useless within your application.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
Someone helped you? their helpful post.
Help:Forums FAQ|How To Ask Questions The Smart WayResources:The Java Tutorials|Glossary for Java|NetBeans IDE|Sun DownloadsWeb:WritOnceTips:Is your IDE the best?|Which Application Server?
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
3d array filled with garbage values jon80 New To Java 5 01-01-2009 11:12 PM
Interacting with the Java Garbage Collector Java Tip Java Tips 0 03-28-2008 09:04 PM
Java performance Issues (III) - Garbage collection JavaForums Java Blogs 0 01-30-2008 02:01 PM
Garbage Collection JavaForums Java Blogs 0 08-04-2007 03:24 AM
How to use the garbaje collector Eric Advanced Java 2 06-29-2007 02:56 AM


All times are GMT +2. The time now is 02:45 PM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org