Bastogne (SCS) on Mac OS

I am having some issues with the Bastogne (SCS) module - when I run it, it seems to load just fine, and has pieces in what look like appropriate locations, but the map itself never loads. I’ve let the software run for several hours, and still no map loaded.

My platform is:
Mac OS (10.4.11)
VASSAL 3.1.5

I’ve tried both the Bastogne 1.0 AND 1.1 modules, and both display the same behavior.

Has anyone else seen similar behavior? Anyone have a work-around or other suggestions?

Thanks for your help!

Tim

Thus spake “loiosh13”:

Look in Preferences for the module:

  1. Do you have high-quality scaling turned on or off?

  2. Do you have memory-mapped images turned on or off?

  3. To what do you have your maximum heap set to?

Then, check:

  1. How much RAM do you have?


J.


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

Post generated using Mail2Forum (mail2forum.com)

On May 20, 2009, at 8:02 AM, loiosh13 wrote:

Hmmm. I just tried this and it seemed to work fine, but I have a
slightly different Mac version.

Mac OS (10.5.6)
Vassal 3.1.5
Intel Core 2 Duo
4GB RAM

The module worked fine with the default 256M/512M RAM allocation,
although there was some initial sluggishness loading the map.

I can try this at home later with a 10.4.11 system and G5 PowerPC (2GB)


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

Post generated using Mail2Forum (mail2forum.com)

I’ll be very interested to know your results - my set up is:

Mac OS 10.4.11, PowerPC/G5, 1 Gig Ram
Vassal 3.1.5

I’ll post the other info requested in a bit - I’m in the middle of an Up Front game (offline, but still VASSAL ;).

Tim

OK, I had high-quality scaling on, but I’m trying it off right now (so far to no effect).

Memory-mapped images has been off both times.

Max heap was set to 1024 (and, hence, all memory available, so I’ve dropped that down to 512).

Total RAM is 1 GB.

Thoughts or comments?

Thanks,

Tim

Thus spake “loiosh13”:

You should leave that on.

Also turn this on.


J.


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

Post generated using Mail2Forum (mail2forum.com)

On May 20, 2009, at 10:00 AM, Thomas Russ wrote:

Well, the behavior was quite different on the G5 with 10.4.11

The counters appeared in a couple of seconds, but the map had not yet
loaded after 10 minutes (!)

This was fixed by switching to memory-mapped images, but it still
seemed quite odd. The map isn’t especially large, but it still took
a while to load, a bit over one minute. And after zooming in on the
map, there was a noticeable lag in the appearance of each tile of the
map.

I don’t really know if this is an OS version problem or if it depends
on the underlying processor.

In both cases, the memory allocation was the same (256/512M).

I looked at the activity level, but nothing in particular stood out,
other than that there were a lot of ports opened and it seemed like a
fair number of threads (around 42).

This does seem a bit of a mystery to me.

I tried it again, and it was still over one minute to load the map,
sucking up lots of CPU cycles while processing. The map isn’t
especially large, only a 3MB png, but it seems to have quite a large
pixel size:

identify images/Bastogne-Map-vassal.png
images/Bastogne-Map-vassal.png PNG 6800x4400 6800x4400+0+0 8-bit
PseudoClass 256c 3.274mb 1.410u 0:05

But the bottleneck does appear to be the image processing.
Increasing the max ram from 512M to 1024M didn’t have any noticeable
effect. Zooming in to 100% was quite sluggish. Tiles appeared very
slowly.

Still, I don’t see why there should be such a difference between a
1.8GHz G5 PPC and a 2.4GHz Core 2 Duo. There might be some
difference from the graphics support. The PPC has a 64MB NVidia GE
Force 5200. I don’t recall offhand what the laptop has, but it does
have a larger video ram and faster graphics processor.

Sorry I can’t provide much else in the way of data.

-Tom.


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

Post generated using Mail2Forum (mail2forum.com)

Tom,

No worries - you’ve at least gotten me to a workaround (the memory mapping thing). It’s still slower than molasses, but it’s better then not loading at all.

Maybe with all this data, Hans (the module developer) can make some headway into figuring out what the issue is (or, those of us with older Macs just live with sluggish initial loading and zooming).

Thanks again for trying it on your G5!

Regards,

Tim

P.S. Further data - it took a good 3 minutes to load the map on my G5 (running Mac OS 10.4.11, w/ 1 GB of memory), also set for 256/512 and with memory mapping on. Without memory mapping, I don’t know how long it took - longer than I ever had the patience to wait.

On May 22, 2009, at 10:25 AM, loiosh13 wrote:

Actually, I remember some other observations that I made.

While loading the map, the CPU is really going like gangbusters.
Vassal is taking between 60-90% of the CPU cycles. There is really no
I/O activity to speak of, so whatever is taking the time, it is
working entirely in memory.

If I were to speculate, I’m thinking that somehow the scaling of this
particular image isn’t happening very efficiently, but that’s about
all I can come up with. I don’t know if the particular PNG used for
the map is in any way unusual. I did note that it wasn’t especially
small in dimensions (6800x4400) even though it was only about 3 MB in
stored disk size. The expanded in-core size of the image would have
to be somewhere in the neighborhood of 115 MB.


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

Post generated using Mail2Forum (mail2forum.com)

Thus spake “loiosh13”:

Try this: Turn memory-mapped images off, reload the module, and then after
waiting a few minutes, chech the errorLog to see if loading the image has
failed.


J.


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

Post generated using Mail2Forum (mail2forum.com)

Thus spake Thomas Russ:

I doubt that it’s the scaling that you’re waiting for. If you have high-
quality scaling turned on, then scaling any two images with the same
dimensions will take about the same amount of time. Hence, if scaling
is ever fast for you, then the problem is unlikely to be the scaler.

My guess is that something in OS X or the JVM for OS X is having trouble
creating images of that size, or possibly that memory-mapped files support
in OS X or the JVM for OS X is not very efficient. (For comparison, th
Bastogne map loads in less than one second on my Linux laptop.)

What would be most helpful is if you could profile VASSAL in jvisualvm
while the map image is loading, and send me the profiling data. That
way I could see what exactly is taking all that time.


J.


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

Post generated using Mail2Forum (mail2forum.com)

On May 23, 2009, at 9:38 AM, Joel Uckelman wrote:

I’ll have to look for a different tool.
jvisualvm doesn’t seem to be part of the Apple Java distribution.

But I’ll see what might be available.

BTW, it does load in about 2 seconds on my Intel/OS 10.5 laptop.
It was just slow on my PPC/OS 10.4 laptop.

Now, if someone could try this on PPC/OS 10.5 we could try to see
if it is related to processor architecture or OS version.


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

Post generated using Mail2Forum (mail2forum.com)

Thus spake Thomas Russ:

denverdev.blogspot.com/2008/09/s … c-osx.html

sleberknight.com/blog/sleberkn/tags/osx

Otherwise, you could try the YourKit profiler.


J.


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

Post generated using Mail2Forum (mail2forum.com)

On May 27, 2009, at 1:02 AM, Joel Uckelman wrote:

Unfortunately, visualvm requires Java 1.6, which isn’t available
under OS X 10.4.x

Actually, I was thinking of trying Apple’s Shark profiler instead.


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

Post generated using Mail2Forum (mail2forum.com)

Here is the shark profiles.

I suppose I should also try it on the 10.5 machine for contrast. But that’s at work.

These are just text files, but they had to be zipped to comply with the file suffix restrictions of the forum…

Thus spake “tar”:

I’m unsure how to read these. In the tree view, does the line

  • 1.3 min MappedImageUtils::getImage (VASSAL.tools.image.memmap)

mean that MappedImageUtils.getImage() and it’s children took 1.3 minutes
to execute?

If that’s so, then something is awfully screwed up, as it takes about 2
seconds on my laptop. I’m sure that my laptop is not 40x times faster than
your test machine.

Here’s what I see:

  • 1/6 of the of the time used by MappedImageUtils.getImage() is for the
    call to MappedImageUtils.toType(). This method converts images from one
    type to another, and is called only when the image was loaded as neither
    INT_RGB nor INT_ARGB. All it does is copy rows from one image backed
    by a memory-mapped file to another, and so will be slow if the underlying
    memory-mapped file implementation is slow. If we could get the image as
    one of the INT types, we wouldn’t need to call toType() at all.

  • The rest of the time used by MappedImageUtils.getImage() is used by
    the call to Graphics2D.drawImage() in MappedImageUtils.loadWithToolkit().

The two of these together suggest to me that either OS X 10.4 or Java
for OS X 10.4 has poor support for memory-mapped files.

Could you also do the same profiling on the same machine with memory-mapped
files turned off?


J.


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

Post generated using Mail2Forum (mail2forum.com)

On May 27, 2009, at 7:35 AM, Joel Uckelman wrote:

There is also a third possibility, which is that it somehow depends on
the processor architecture (PPC vs Intel).


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

Post generated using Mail2Forum (mail2forum.com)

I am not following the technical side of this.

I created the map again in the hopes that maybe that will help.

I put the new mod up and named it v.1_1 mac test
vassalengine.org/community/i … ule_id=698

I hope this helps

Could you do the same profiling you did before, but with memory-mapped images turned off? I can’t make any progress on this problem without that information.

Thus spake “uckelman”:

Please try 3.1.10-svn5918 and let me know if this problem is resolved.

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)