Streaming algorithm

Started by radvani7, December 08, 2005, 09:36:01 PM

Previous topic - Next topic

EgonOlsen

Quote from: "raft"what i was trying to say that i'm not sure if java spec dictates to perform a complete garbage collection if no memory is available, does it ?
As fas as i know, i doesn't even dictate a garbage collection at all, i.e. you could write a VM according to the specs that doesn't do any garbage collection (as pointless as such a VM would be). The SUN-VM should perform a complete collection before throwing an out of memory. Everything else would be just plain stupid.

raft

ehm, so i have an un-generatable memory leak somewhere, thanks for the gift :roll:
r a f t

raft

later, i've remembered an article i read about garbage collection stuff. here is a part from it:

QuoteOne case where a finalize method delayed GC was discovered by the quality assurance (QA) team working on Swing. The QA team created a stress testing application that simulated user input by using a thread to send artificial events to the GUI. Running on one version of the toolkit, the application reported an OutOfMemoryError after just a few minutes of testing. The problem was finally traced back to the fact that the thread sending the events was running at a higher priority than the finalizer thread. The program ran out of memory because about 10,000 Graphics objects were held in the finalizer queue waiting for a chance to run their finalizers.

i do not have any finalizers and jpct neither has as far as i know. on the other hand this writing means that one can have an OutOfMemoryError even if there are some objects waiting to be collected

plain stupid ? yeah, kind of :roll:

for the curious here is the article by sun: http://java.sun.com/docs/books/performance/1st_edition/html/JPAppGC.fm.html

Quoter a f t

EgonOlsen


rolz

Try increasing heap size with -Xmx / -Xms params to jvm. If it works fine then:
- leave as is, update memory requirements ;)
- review you code for possible optimizations that will reduce memory usage

If not, then you may say you've got a memory leak. You will have to review the code / launch application under profiler to discover the problem. From the past experience the problem is most likely that there are references to "obsolete" objects stored inside your "active" objects in a running threads:

- in object's properties
- in hashmaps/collections (caches, "listeners", etc.)
- in another thread, that is still alive (daemons, launching actions in new thread)
- non-static inner classes - they still carry a reference to outer class instance
- AWT/Swing elements. They might have your objects in model/listeners
- double check static objects - 90% of problems go there

If i were you, I'd use JProfiler (it's commercial but you may find a workarond at astalavista.box.sk if you need it badly) and it's memory monitor to find out more about memory usage in your application.
Regards,
Andrei

eye1

Quote from: "radvani7"
The custom scaling worked out very well; I just multiplied a single-axis scale matrix with the rotation matrix, and set that composite matrix as the Object's rotation matrix.

Since I don't use the build-in scaling it doesn't cause any problems there!

Hm.. Don't really know how to do that  :? ...