Forums Register Login

Garbage collection Question

+Pie Number of slices to send: Send
Need little advise on Garbage collection,

I have heard that whenever the gc process is running, we try to do some other process, it will not execute unless the gc process is complete.

Please let me know if iam correct or wrong.
If wrong, need little details and explaination on the same.
+Pie Number of slices to send: Send
Hi Dinesh,

the garbage collector of Java runs as a background daemon in a special thread whenever the JVM is started. Of course it regularly has to do it's job so it obviously consumes resources like CPU power. On a single processor system it's clear that there's no chance for other threads to proceed if the garbage collector thread is active because there's no real multi threading on such system. But unlike earlier version of Java and the JVM the garbage collector is really, really clever and you don't notice it doing its work in normal applications. It would be no problem to provoke lags in your program flow by allocation and deallocation enormous amounts of memory without sense but this would also lead to inefficiencies in programming languages without garbage collector.

Marco
I didn't say it. I'm just telling you what this tiny ad said.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 474 times.
Similar Threads
Duration For H1B
objects eligible for gc
Return values of methods
islands of isolation in Garbage Collection
Garbage collection.
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 07:18:43.