Hi, Are you sure you aren't leaking memory? (by keeping a reference to an ever growing state -- do you use memoize?)
Christophe On Sat, Oct 3, 2009 at 10:22 PM, Elliott Slaughter < elliottslaugh...@gmail.com> wrote: > > Thanks. > > JVisualVM shows the initial memory usage is a couple hundred MB, then > decreases to levels about what you described. I'm using a 64-bit Java > with the -server option to increase the max heap size. > > But in my actual application, the memory performance is much worse: > the heap size keeps growing until it gets up to about 1000MB (and > unlike the previous example, actually uses most of that space). Once > it hits about 1000MB, instead of running GC once every couple of > seconds, it runs GC almost constantly, causing my application to > basically freeze. (Since the application is a game, any long-running > GC is a problem.) > > Here is a screenshot from JVisualVM. In the CPU graph, you can see the > purple spikes are where global GCs happen. At first, they happen > occasionally, but at the end, GC is running frequently and repeatedly. > > http://imgur.com/fNFOr.png > > Of course, my application is much more complex than the previous > example, and it's entirely possible I'm missing some sort of leak in > my code. But at the core of the program, I'm just using a tree of > nested maps and references, so theoretically they should have similar > performance characteristics. > > Thanks again. Any further help would be appreciated. > > On Oct 3, 1:24 am, hoeck <i_am_wea...@kittymail.com> wrote: > > Hi, > > > > to measure memory requirements of java programs, it is better use a > > tool like jvisualvm. The JVM process aquires memory as it needs > > according to its max heap and max permgen settings. > > I ran your little snippet on my machine with java -Xmx5M -jar > > clojure.jar, and > > while jvisualvm reported around 2M heap usage (like a bare clojure > > REPL), top showed a memory usage of about 25 Megabytes. > > > > The default max heapsize is, at least on my machine with a 32bit JVM, > > at around 128M, and lots of it will be allocated up front, regardless > > how > > much heap the running java programm needs. > > > > Erik > > > -- Professional: http://cgrand.net/ (fr) On Clojure: http://clj-me.blogspot.com/ (en) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---