Error Exceeding Heap Size .... But ....

Howdy Gents,

Am building a module currently measures at 32 mb. Am trying to install a hex grid on the map. Nothing special, just the typical hex grid.

Beginning Heap Size 1024
1st. Attempt I got the exceeding heap size when I was about 85% done.

Increased Heap Size to 2048
Cleared Cashe.
2nd Attempt I get the same error at less than 10% complete.

Any ideas what’s going on, why, and what can be done about it?

Thus spake Cundiff:

Howdy Gents,

Am building a module currently measures at 32 mb. Am trying to install
a hex grid on the map. Nothing special, just the typical hex grid.

Tne size of the module is irrelevant. What matters for heap sizing is
usually the dimensions of the images.

Beginning Heap Size 1024
1st. Attempt I got the exceeding heap size when I was about 85% done.

Increased Heap Size to 2048
Cleared Cashe.
2nd Attempt I get the same error at less than 10% complete.

Any ideas what’s going on, why, and what can be done about it?

10% and 85% complete of what? Is this image tiling?

How large is the largest image in use?


J.

The map is 20.5 mb
15713 pixels x 10300

PNG? Try optimizing it first.

There are several options, to include

ezgif.com/optipng

No, it’s a jpg. The png was more than 3 times the 20.5 mb size (79.8 mb).

Thus spake tinjaw via messages:

“Cundiff” wrote:

The map is 20.5 mb
15713 pixels x 10300

PNG? Try optimizing it first.

Nope. That won’t make any difference. Nor will changing the file type.

What matters is the uncompressed size, which is 15713 * 10300 * 4 bytes
per pixel = 647375600 bytes, or around 617MB.

If it’s the tiler which is running out of memory, then your image is
exceeding our esitmate for how much memory the tiler will require.


J.

It’s running out of memory while I attempt to outline the map grid while identifying it as a Zone. My plan was then to lay the grid inside the Zone. But before I can even get the map outlined I round out of memory.

This could presage coming problems as map and counter art become more involved and larger. This has been a trend in game artwork for over 20 years. I can remember when a map file was large at 3 mb.

There is an easy solution. Break the map in to smaller ‘Boards’

I can easily break the map file into smaller boards. I cannot as easily program a vassal game with multiple map boards. Never done that before. And do not have an easy example that explains every step. In short I don’t know how to create a multi board vassal mod.

What if I drew every hex on the board as a single independent zone? There might be hundreds of them, but might that work without having to divide the map up?

Thus spake Cundiff:

What if I drew every hex on the board as a single independent zone?
There might be hundreds of them, but might that work without having to
divide the map up?

I still don’t understand exactly the steps you were taking. What were
you doing, step by step?


J.

The map is installed thus
Main Map [Map Window]
[Map Boards]
Game Map [Boards]
[Multi-Zoned Grid]
Main Hex Map Zone

Now under this Zone I am drawing the general outline of the hex grid.
(This is how I get a nearly exact hex grid when I then …)

Add Hex Grid (inside the Main Hex Map Zone).

However, at the moment I cannot get to the Add Hex Grid, because when I add the outline of the main map hex grid zone, I get the memory limitation.

So the actual problem is the the Zone Editor is failing when trying to drag a Rectangle around a 617MB map.

Handling Boards is very easy. You have to repeat what you do at the Map level (Zone, Grid, Numbering) on each board and then provide a default board setup with all the boards defined in their proper place. You can copy the grid and number between boards and then tweak to fit each board.

Other than the setup, there is no real difference, Boards are pretty much invisible once the game is underway and you don’t have to change the operation of the pieces.

One tip, don’t have hex centres on board edges.

So the actual problem is the the Zone Editor is failing when trying to drag a Rectangle around a 617MB map.

Bingo ! at least if that’s the actual size of the map.

Given this parameter, can the program handle 720 separate zones representing each hex as an individual zone? I’d hate to work through this only to find out after drawing 550 hexes that I couldn’t go any further due to memory limitation issues.

DONT DO THAT. What a nightmare to maintain and asking for performance issues.

There are several options before doing that:

  1. Break the Map into Boards.
  2. Don’t use a Zoned grid, just create the hex grid directly under the main map board.
  3. Create the Zone by entering the co-ordinates directly instead of dragging a rectangle 0,0 15713,0 15713,10300 0,10300

The fact that the Zone Editor is crashing has no impact on how the module will run, as long as the Map tiles, you should be ok.

Unfortunately the hex map is only part of the full map panel. There are several zones for things like Time Record Track, Holding Spaces for Units Building (x3), Units Dead (x3), etc. The actual Hex Grid is also irregular. It’s not a rectangle or square. There’s also a ring of hexes sort of like Perimeter Zones in an Area Movement Game, that are NOT the same size as the regular hex map hexes, and they are Not directly attached to the regular hex grid, and each hex in the perimeter is individual in size and location. It’s a real nightmare map. Looks deceptively simple … until.

The other fun part of this is that this is a playtest map, subject to change and there WILL be changes. The vast majority of my builds are for playtest purposes. The professional Guru’s build the final product in most cases. I get the fun of beating my head against a wall first.

If you want to get somewhere quickly, I would strongly suggest cutting the map into 4 pieces. That should resolve the memory issue. It’s a bit more one-off setup work for you, but the users see no difference.

How would I make a single reporting hex grid that covers all 4 maps?

You’re not making 4 maps, you’re making 4 boards that fit together to make 1 map.

In your [Map Window] component, you have [Map Boards]. You create your 4 separate boards under there and give each it’s own independent zones, hex grid and grid numbering.

If you the double click on the [map boards] component, there is a ‘Select Default Board Setup’ button that allows you specify how the 4 boards fit together to make the map. This will be used automatically when you start a new game.

From then on, you can generally ignore the fact that your Map is made up of 4 Boards

Each board reports it’s portion of the grid independently. The trick is you have to tweak the grid numbering on each board to report the correct co-ords.