I’m attempting to load the ‘World in Flames’ module with the new version of Vassal (3.1.4). When I attemted to load the module I got a message saying that my heap size was too large and that I should reduce the heap size.
When I go into prefences the default initial heap is 256 MB and the maximum heap is 512 MB. What should I change these to?
my HP laptop has 980 MHz with 504 MB of RAM, in case that makes a difference.
I would expect World in Flames to be a fairly large size module, so
your machine parameters may be a bit on the tight side for actually
being able to play it. Typically your performance will degrade
considerably if you use a larger memory size than your actual RAM. On
the other hand, one of the points of having virtual memory is to allow
you to do just that. Things will be a bit slower at times. That
means at certain points there will likely be some delays in getting a
response from the program if you have to use virtual memory.
Windows tends to not handle virtual memory quite as nicely as Linux or
Mac OS, so with an HP laptop it will also be a bit slower. Laptops
will often also suffer, since they will also often have slower disks
and tend to want to put the disk to sleep to save energy.
As an aside to the development team:
It seems that this question is now coming up a bit more frequently
since the “sanity checks” for heap size went it. It is likely to be
potentially confusing for users when a module that they used to play
suddenly complains with the newest Vassal version. This probably
calls for a FAQ entry.
I also wonder if the rule about heap < RAM is a bit too
aggressive, particularly with low RAM machines. Perhaps the warning
should be worded a bit less drastically if the suggestion is to go
below something like 512MB. It may end up being a trade-off between
running slowly or not running at all.
My feeling is that we should explain what’s going on a bit better in
the warning messages.
Have you tried running VASSAL when part of the heap is not in RAM? On
Windows, there’s so much thrashing that it makes the whole machine unusable.
I’d say that it’s worse than being completely unable to run VASSAL, since you
might have to do a hard reset to stop the thrashing.
Of course, if you set the heap size too small, you end up making
Vassal run very slowly, since it can end up spending almost all of its
time in the garbage collector. I recall using PcGen with the
(ludicrously low) default Mac heap settings (64MB, IIRC) and finding
that the performance was abysmal. It was so slow as to be unusable,
and nearly caused me to give up on the application entirely. By
setting the heap size to something reasonable, performance increased.
I can generally avoid using Windows, so I don’t have direct experience
with the phenomenon there. I have run other Java programs with heap
sizes over the RAM size in the past without ill effect on Mac OS X.
But not lately, since the RAM on my current machines is high enough
that I would need to use a 64-bit VM to run such a test. And then it
likely wouldn’t even use the maximum heap size.
I think using a low minimum heap size for RAM-constrained machines
makes a lot of sense, but some notion of the trade-offs should be
mentioned. I realize that this is a difficult issue to convey to a
non-technical audience, however. It really would need something with
a bit more explanation, especially given the apparently grave
consequences of hanging the entire machine.
Having the max heap size be more than the available RAM is different than
having the actual heap size be more than the available RAM. You’re not
going to get paging until the amount of heap actually in use no longer fits
I really think there is something wrong with this “feature”:
I keep getting max heap too large even at 1024 Mb, despite having 4 Gb of RAM. (It’s on XP, unlike Vista which gobbles up half that just to give you a “pretty” desktop )
Then, the mod doesn’t open as it runs out of memory because it has reset itself to the default. Admittedly, I was trying to open an import of an ADC mod, so it could be oversize anyway, but I can’t see why the settings are so conservative.
Java needs to be able to reserve consecutive address space for its heap.
Windows XP is quite addled in how it allocates memory, such that you might
well have nearly 4GB RAM free without having any 1GB chunks which are free.
Can you send me the module? I’d like to see how much memory it actually
I was able to import with max heap set to 1GB. I can load the module
with max heap at 512MB if I have “Prefer memory-mapped images” turned
This game has the weirdest-shaped map I’ve ever seen, I guess because
it omits most of the parts of the DDR and Czechoslovakia which would
just be useless rear areas, and instead follows the West German border.
If you cut the map into pieces such that you had five columns and about
four rows, you could reduce memory usage considerably by having no images
for the huge empty areas in the lower left and lower right corners.