Heap size?

Hi

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.

Thanks

John

Thus spake “jhammond”:

You need to decrease your maximum heap size to less than the amount of
RAM your machine has. I would suggest trying about 300MB, and turning
on “Prefer memory-mapped images” (in the Preferences) also.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

On Apr 19, 2009, at 12:12 PM, jhammond wrote:

Well, that might really be a bit tough.

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:

  1. 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.

  2. 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.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Thus spake Thomas Russ:

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.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

On Apr 20, 2009, at 9:39 AM, Joel Uckelman wrote:

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.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Thus spake Thomas Russ:

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
in RAM.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

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 ) :laughing:

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.

Thus spake “nyhotep”:

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
requires.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

I take your point on consecutive memory, but the message seems to crop up even with default settings.

The module was converted from the ADC2 central front mod, by Bryan Barnard, available at Die HauptKampfLinie:

67.155.107.229/Game_Sets/SPI/spi.htm

The units show up, but no map. It’s possible my conversion went wonky.

2009/5/8 nyhotep <messages@forums.vassalengine.org (messages@forums.vassalengine.org)>

Unfortunately, a bug was introducted in 3.1.4 that caused some images to be completely transparent.

You can convert the module using an earlier version and then use the converted module in the latest version. The bug will be fixed in 3.1.5.

If you’re using windows, you can get an earlier version here:

http://prdownloads.sourceforge.net/vassalengine/VASSAL-3.1.3-windows.exe

  • M.

Post generated using Mail2Forum (mail2forum.com)

Thus spake “nyhotep”:

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
on.

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.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Thus spake Joel Uckelman:

I should mention that this is with the current development version,
3.1.5-svn5597, which you can get here:

nomic.net/~uckelman/tmp/vassal/


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Thanks, all, I’ll give it a go.