Are you launching Java with any flags? I think by default the heap limit is quite small (128 MB?)
I use "java -server -Xmx1g ..." as my default for 1 gig of ram; you should be able to take it from there (-server makes long-running processes go faster, and perhaps more memory-efficient (?)). As far as I know there's no down side to increasing the upper limit in this way, since Java still starts with a small heap and grows it on demand. -Jason On Feb 2, 5:57 pm, canadaduane <[email protected]> wrote: > I have a project where I would like to have a much larger world than > the 80x80 world in Rich's ants.clj [1] demo. When I bring the world > up past about 600x600, I get a java.lang.OutOfMemoryError. > > Is this expected? If so, is there another reasonable way to represent > a large grid with concurrent processes roaming about? At first, I > only need to store a floating-point value in each cell location. But > I'm also curious to know why this is such a huge memory hog (I have a > 2 GB system). I'm also ignorant of JVM issues, so any tips there > would be helpful. > > Here is the relevant code: > > ; larger world > (def dim 600) > > (defstruct cell :food :pher) > > ;world is a 2d vector of refs to cells > (def world > (apply vector > (map (fn [_] > (apply vector (map (fn [_] (ref (struct cell 0 > 0))) > (range dim)))) > (range dim)))) > > Thanks! > Duane Johnson > > [1]http://clojure.googlegroups.com/web/ants.clj --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---
