Create account / Log in

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

Talk about module design ideas and techniques.

Moderators: uckelman, Tim M

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

Postby Cundiff » August 4th, 2020, 8:31 pm

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?
Cundiff
 
Posts: 162
Joined: January 3rd, 2017, 8:51 am

Re: Error Exceeding Heap Size .... But ....

Postby uckelman » August 4th, 2020, 8:42 pm

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.
User avatar
uckelman
Site Admin
 
Posts: 8847
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Re: Error Exceeding Heap Size .... But ....

Postby Cundiff » August 4th, 2020, 9:26 pm

The map is 20.5 mb
15713 pixels x 10300
Cundiff
 
Posts: 162
Joined: January 3rd, 2017, 8:51 am

Re: Error Exceeding Heap Size .... But ....

Postby tinjaw » August 4th, 2020, 9:28 pm

Cundiff wrote:The map is 20.5 mb
15713 pixels x 10300


PNG? Try optimizing it first.

There are several options, to include

https://ezgif.com/optipng
User avatar
tinjaw
 
Posts: 31
Joined: April 10th, 2020, 12:11 pm

Re: Error Exceeding Heap Size .... But ....

Postby Cundiff » August 4th, 2020, 9:36 pm

No, it's a jpg. The png was more than 3 times the 20.5 mb size (79.8 mb).
Cundiff
 
Posts: 162
Joined: January 3rd, 2017, 8:51 am

Re: Error Exceeding Heap Size .... But ....

Postby uckelman » August 4th, 2020, 9:40 pm

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.
User avatar
uckelman
Site Admin
 
Posts: 8847
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Re: Error Exceeding Heap Size .... But ....

Postby Cundiff » August 4th, 2020, 10:19 pm

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.
Cundiff
 
Posts: 162
Joined: January 3rd, 2017, 8:51 am

Re: Error Exceeding Heap Size .... But ....

Postby Brent Easton » August 4th, 2020, 10:27 pm

There is an easy solution. Break the map in to smaller 'Boards'
User avatar
Brent Easton
 
Posts: 3168
Joined: December 21st, 2007, 3:06 am
Location: Berry, NSW, Australia

Re: Error Exceeding Heap Size .... But ....

Postby Cundiff » August 4th, 2020, 10:59 pm

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.
Cundiff
 
Posts: 162
Joined: January 3rd, 2017, 8:51 am

Re: Error Exceeding Heap Size .... But ....

Postby Cundiff » August 4th, 2020, 11:31 pm

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?
Cundiff
 
Posts: 162
Joined: January 3rd, 2017, 8:51 am

Re: Error Exceeding Heap Size .... But ....

Postby uckelman » August 4th, 2020, 11:35 pm

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.
User avatar
uckelman
Site Admin
 
Posts: 8847
Joined: December 10th, 2007, 9:48 am
Location: Durham, England

Re: Error Exceeding Heap Size .... But ....

Postby Cundiff » August 4th, 2020, 11:43 pm

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.
Cundiff
 
Posts: 162
Joined: January 3rd, 2017, 8:51 am

Re: Error Exceeding Heap Size .... But ....

Postby Brent Easton » August 4th, 2020, 11:57 pm

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.
User avatar
Brent Easton
 
Posts: 3168
Joined: December 21st, 2007, 3:06 am
Location: Berry, NSW, Australia

Re: Error Exceeding Heap Size .... But ....

Postby Cundiff » August 5th, 2020, 12:02 am

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.
Cundiff
 
Posts: 162
Joined: January 3rd, 2017, 8:51 am

Re: Error Exceeding Heap Size .... But ....

Postby Cundiff » August 5th, 2020, 12:49 am

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.
Cundiff
 
Posts: 162
Joined: January 3rd, 2017, 8:51 am

Next

Return to Module Design

Who is online

Users browsing this forum: No registered users and 4 guests