Results 1 to 2 of 2
- 07-22-2008, 01:28 PM #1
Member
- Join Date
- Jul 2008
- Posts
- 3
- Rep Power
- 0
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!!
- 07-23-2008, 11:56 AM #2
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
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.
Similar Threads
-
3d array filled with garbage values
By jon80 in forum New To JavaReplies: 5Last Post: 01-01-2009, 10:12 PM -
Interacting with the Java Garbage Collector
By Java Tip in forum Java TipReplies: 0Last Post: 03-28-2008, 08:04 PM -
How to use the garbaje collector
By Eric in forum Advanced JavaReplies: 2Last Post: 06-29-2007, 01:56 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks