# Possible issues with memory

**URL:** <https://forum.vassalengine.org/t/possible-issues-with-memory/5035>\
**Category:** Module Design\
**Created:** [June 22, 2012, 2:58pm UTC](https://forum.vassalengine.org/t/possible-issues-with-memory/5035 "2012-06-22T14:58:42Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrono280](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/c/47e85d/32.png) [@chrono280](https://forum.vassalengine.org/u/chrono280)\
**Post date:** [June 22, 2012, 2:58pm UTC](https://forum.vassalengine.org/t/possible-issues-with-memory/5035/1 "2012-06-22T14:58:42Z")

</div>

I’m designing the expansion module for Space Empires Close Encounters.

Using 3.2.0 of Vassal I am employing a lot of the new features such as asthmatic expressions and literal strings for shortcut keys.

With the new expressions I am able to employ the “Production Sheets” found in the board game. These basically work like spreadsheets. I’m using counters to represent each cell.

I noticed as I was setting this up that it seems to be taking an enormous amount of memory. I know JAVA isn’t the most memory friendly, but do you think I will run into an issue where the module might become un-runable, at least on some machines?

With the Production Sheets as they are now, there are 7 screens, each doing different things, like the one below for each player (so 28 total). There’s still more work to be done and cell counters to be added but running it as it is now JAVA takes up about 530MB of memory and VASSAL another 60MB on my Win 7 machine.

I’m getting worried it may increase even more and could use some reassuring/pointers before I put a many more hours into finishing the module. I don’t want to do a ton of work only to have the thing crash on machines with ~1-2 GB RAM.

Thoughts? Thanks in advance

![](http://img862.imageshack.us/img862/3926/seceprodsheet.png)

EDIT: I’m using 3.2.0-svn8213 here

---

<div class="post-metadata">

**Author:** ![uckelman](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/uckelman/32/10020_2.png) [@uckelman](https://forum.vassalengine.org/u/uckelman)\
**Post date:** [June 22, 2012, 3:10pm UTC](https://forum.vassalengine.org/t/possible-issues-with-memory/5035/2 "2012-06-22T15:10:29Z")

</div>

Thus spake chrono280:

> I’m designing the expansion module for Space Empires Close Encounters.
> 
> Using 3.2.0 of Vassal I am employing a lot of the new features such as  
> asthmatic expressions and literal strings for shortcut keys.
> 
> With the new expressions I am able to employ the “Production Sheets”  
> found in the board game. These basically work like spreadsheets. I’m  
> using counters to represent each cell.
> 
> I noticed as I was setting this up that it seems to be taking an  
> enormous amount of memory. I know JAVA isn’t the most memory friendly,  
> but do you think I will run into an issue where the module might become  
> un-runable, at least on some machines?
> 
> With the Production Sheets as they are now, there are 7 screens, each  
> doing different things, like the one below for each player (so 28  
> total). There’s still more work to be done and cell counters to be  
> added but running it as it is now JAVA takes up about 530MB of memory  
> and VASSAL another 60MB on my Win 7 machine.

To what do you have your max heap set for the module?

–  
J.

---

<div class="post-metadata">

**Author:** ![chrono280](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/c/47e85d/32.png) [@chrono280](https://forum.vassalengine.org/u/chrono280)\
**Post date:** [June 22, 2012, 3:13pm UTC](https://forum.vassalengine.org/t/possible-issues-with-memory/5035/3 "2012-06-22T15:13:42Z")

</div>

It’s set to 512MB in my file → prefs. I have never messed with this option, but I’ve read about it concerning ‘out of memory’ errors.

I’ve never received any errors, I’m worried about that and performance though. Thanks again

---

<div class="post-metadata">

**Author:** ![uckelman](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/uckelman/32/10020_2.png) [@uckelman](https://forum.vassalengine.org/u/uckelman)\
**Post date:** [June 22, 2012, 3:34pm UTC](https://forum.vassalengine.org/t/possible-issues-with-memory/5035/4 "2012-06-22T15:34:51Z")

</div>

Thus spake chrono280:

> It’s set to 512MB in my file → prefs. I have never messed with this  
> option, but I’ve read about it concerning ‘out of memory’ errors.
> 
> I’ve never received any errors, I’m worried about that and performance  
> though. Thanks again

Have you found that tiles which you’ve seen before are not displaying  
immediately? If that’s happening, then maybe your module design is  
squeezing the tile cache a bit. If that’s not happening, then I doubt  
that you have anything to worry about.

–  
J.

---

<div class="post-metadata">

**Author:** ![chrono280](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/c/47e85d/32.png) [@chrono280](https://forum.vassalengine.org/u/chrono280)\
**Post date:** [June 22, 2012, 3:40pm UTC](https://forum.vassalengine.org/t/possible-issues-with-memory/5035/5 "2012-06-22T15:40:25Z")

</div>

The main map takes about 7 seconds to so to load in (the background and the at start stacks). That didn’t used to happen. Not game breaking but I can try shrinking the map some. Although I will need to keep the size the same to keep my at start stacks in the right place.

On the production sheets sometimes it takes half a second, but it is livable.

Also I noticed moving a unit on the map now is a bit more delayed that it was before. It used to only happen when large amounts of units were being moved at once. It takes roughly 2-3 seconds for the unit to stop being “translucent” and appear in the new hex with move trail and chat-log annouce of movement. Do you think it is Report that is causing this or something else?

Thanks

---

<div class="post-metadata">

**Author:** ![chrono280](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/c/47e85d/32.png) [@chrono280](https://forum.vassalengine.org/u/chrono280)\
**Post date:** [June 22, 2012, 3:49pm UTC](https://forum.vassalengine.org/t/possible-issues-with-memory/5035/6 "2012-06-22T15:49:28Z")

</div>

Would it also help if I removed unused image files from the VMOD archive file?

---

<div class="post-metadata">

**Author:** ![uckelman](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/uckelman/32/10020_2.png) [@uckelman](https://forum.vassalengine.org/u/uckelman)\
**Post date:** [June 22, 2012, 4:18pm UTC](https://forum.vassalengine.org/t/possible-issues-with-memory/5035/7 "2012-06-22T16:18:05Z")

</div>

Thus spake chrono280:

> The main map takes about 7 seconds to so to load in (the background and  
> the at start stacks). That didn’t used to happen. Not game breaking  
> but I can try shrinking the map some. Although I will need to keep the  
> size the same to keep my at start stacks in the right place.
> 
> On the production sheets sometimes it takes half a second, but it is  
> livable.
> 
> Also I noticed moving a unit on the map now is a bit more delayed that  
> it was before. It used to only happen when large amounts of units were  
> being moved at once. It takes roughly 2-3 seconds for the unit to stop  
> being “translucent” and appear in the new hex with move trail and  
> chat-log annouce of movement. Do you think it is Report that is causing  
> this or something else?

I have no way of telling conclusively without looking at the module.  
Can you post it somewhere?

–  
J.

---

<div class="post-metadata">

**Author:** ![uckelman](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/uckelman/32/10020_2.png) [@uckelman](https://forum.vassalengine.org/u/uckelman)\
**Post date:** [June 22, 2012, 4:18pm UTC](https://forum.vassalengine.org/t/possible-issues-with-memory/5035/8 "2012-06-22T16:18:36Z")

</div>

Thus spake chrono280:

> Would it also help if I removed unused image files from the VMOD archive  
> file?

No, that has no affect whatsoever.

–  
J.

---

<div class="post-metadata">

**Author:** ![uckelman](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/uckelman/32/10020_2.png) [@uckelman](https://forum.vassalengine.org/u/uckelman)\
**Post date:** [June 22, 2012, 6:25pm UTC](https://forum.vassalengine.org/t/possible-issues-with-memory/5035/9 "2012-06-22T18:25:17Z")

</div>

> [@uckelman](#):
>
> Thus spake chrono280:
> 
> > The main map takes about 7 seconds to so to load in (the background and  
> > the at start stacks). That didn’t used to happen. Not game breaking  
> > but I can try shrinking the map some. Although I will need to keep the  
> > size the same to keep my at start stacks in the right place.
> > 
> > On the production sheets sometimes it takes half a second, but it is  
> > livable.
> > 
> > Also I noticed moving a unit on the map now is a bit more delayed that  
> > it was before. It used to only happen when large amounts of units were  
> > being moved at once. It takes roughly 2-3 seconds for the unit to stop  
> > being “translucent” and appear in the new hex with move trail and  
> > chat-log annouce of movement. Do you think it is Report that is causing  
> > this or something else?
> 
> I have no way of telling conclusively without looking at the module.  
> Can you post it somewhere?

I checked the two modules for which you privately sent me links. I used the default max heap of 512MB. In all cases, no matter which scenarios I loaded, the size of the image cache ranged from 75% to 88% of allocated memory, which is what I expected. You’re not having a problem with too little memory.

I can’t replicate the problem you’re having with movement, but my guess is that it’s the painting of the movement trail that’s slow.

---

<div class="post-metadata">

**Author:** ![chrono280](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/c/47e85d/32.png) [@chrono280](https://forum.vassalengine.org/u/chrono280)\
**Post date:** [June 22, 2012, 6:49pm UTC](https://forum.vassalengine.org/t/possible-issues-with-memory/5035/10 "2012-06-22T18:49:59Z")

</div>

Great thanks for looking into it for me, you’ve put me at ease about it
