Run garbage collection
- From: Wojtek Bok <wb@xxxxxxxxxx>
- Date: Mon, 30 Oct 2006 17:17:45 GMT
Is it possible to run garbage collection on a particular instance of a class?
I am manipulating JPG images (rotate, etc). This uses a LOT of memory when processing (about 9Mbytes for a 3MByte image). Once I am done with the
image, all the resources used can be garbage collected.
GC does run when the memory usage gets near 90%, but I would rather it be part of the image processing, that is process the image and right away
recover the memory used.
I know I can request that the JVM run GC overall, but can this be done on a particular object?
.
Relevant Pages
- Re: Why would I use .NET?
... because I spent a lot of time on a Java app thinking ... Sounds like a poorly designed object - not an issue with garbage collection ... Code without gb is more efficient, because you can control the resources. ... these people that do not bother spending money on a new machine for over 5 ... (borland.public.delphi.non-technical) - Re: Garbage Colletor
... People who know a lot more about the garbage collector than I do have in this very newsgroup provided very good explanations as to how very efficient garbage collection actually is. ... The bottom line in any case is that you have no choice but to release your resources explicitly if you can't wait for the GC to invoke "Finalize". ... if your object references only managed data, then the instant your object is no longer referenced itself, ALL memory resources referenced by that object are also no longer referenced, and are released in the same instance the root level object is. ... They exist for explicit releasing of resources, but they aren't needed unless you a) want to keep the object for later reuse, but release resources or b) you want to ensure that unmanaged resources are also freed. ... (microsoft.public.dotnet.languages.csharp) - Re: Garbage Colletor
... It's extremely easy to handle resources in C++ as you stated but the ... Logically speaking, the memory is still in fact available, the moment you release your last reference to it. ... The "using" statement and IDisposable exist for one purpose: to explicitly release resources held by an object without releasing the object itself. ... In fact, the garbage collection model is, at least for that particular operation, much more efficient, because there's no need to go through the entire object cleaning things up. ... (microsoft.public.dotnet.languages.csharp) - Re: 2003 ActiveX control in .NET consumes memory when page is updated with setResults.
... I believe the culprit here is garbage collection under .NET. ... internal object list to track objects for automation. ... In .NET programming, the object doesn't go away until garbage ... >> If I run this exe, you can see the Memory usage gradually increase (in ... (microsoft.public.visio.developer) - Re: Petition for the removal or voluntary departure of Richard Heathfield from this newsgroup
... Do you understand what I mean by resources? ... Correct me if I'm wrong but, unless you are using Garbage Collection, ... out of scope or is deallocated. ... heap allocator and constructed using pointers, ... (comp.programming) |
|