Out of memory because of prototype definitions

Hi,

A solution to a problem as stated in this thread viewtopic.php?f=6&t=5710 created a new one:
My vmod with my highlight definitions implemented makes java run of with all available memory, just removing those definitions solves this problem. I have no idea how a definition, triggered in the middle of a game, can cause problems even loading a module?

Those definitions work in a barebone vmod, but not used in my final vmod. How can I find what causes this?

barebone vmod & a Final vmod (minus tileimages to decrease filesize), both with implemented highlight definitions are available here:
users.telenet.be/helaba/ (definition ‘StandardTile’ has 6 prototype definitions ‘Black Highlights’, ‘Green Hightlights’ and so on, these are the culprits)

inSane

Thus spake inSane:

Those definitions work in a barebone vmod, but not used in my final
vmod. How can I find what causes this?

barebone vmod & a Final vmod (minus tileimages to decrease filesize),
both with implemented highlight definitions are available here:
users.telenet.be/helaba/[2] (definition ‘StandardTile’ has 6
prototype definitions ‘Black Highlights’, ‘Green Hightlights’ and so on,
these are the culprits)

I was looking at this in 3.2.6 just now and can reproduce the problem
with the larger of the two moduels as follows:

  1. Openg the module.
  2. Start a new game.
  3. Select the Black player.
  4. Close the game.
  5. Start a new game.
  6. Select the Black player.
  7. Close the game—which fails.

At the last step, I run out of memory with my max heap set to 512MB.
What I conclude from this is that the state string for a game where
nothing at all has happened in this module is freakishly large, but
I don’t see what the cause of that is.

Are you still having a problem with this?


J.

I’ve experienced similar memory problems. I think I mentioned it before but I couldn’t tell you where.

Basically, the TBK CCG game I’m working on has an extreme amount of automation. It includes a combat computer that automatically sets up combat and calculate results. The module causes Java to uses an incredible amount of memory and the more the module is used, the higher the memory is consumes. It’s like it’s not releasing any memory as the game goes on. Here’s some examples:

Here’s the java.exe memory using

Start Game - 856,156 K
After one player selects a character to use - 959,188 K
Starting Round 1 - 970,440 K
Drawing a Creature Card and opening the Combat Computer - 999,740 K
Fight first combat segment - 1,001,812 K
Fight second combat segment - 1,003,032 K
Fight third combat segment (creature killed) - 1,003,828 K

At this point the combat computer is closed, the card removed. Draw new creature.

Draw new creature, combat computer reopened - 1,004,992 K
Fight first combat segment - 1,005,912 K
Fight second combat segment - 1,006,696 K
Fight third combat segment - 1,007,448 K
Fight fourth combat segment (creature killed) - 1,008,368 K

This demo is with just one person in the game encountering 2 creature cards. As you can see, Java memory just keeps piling up the memory usage till the game bogs down and crashes under it’s own weight. It seems that any action, even just moving a card from here to there, increases the memory usage and never let’s it go.

The simple act of closing the game has run up the memory to 1,119,228 K

I’ve clicked the button for not wanting to save a game so the game is now closed and the memory is still set to 1,092,248 K

Thus spake DrNostromo:

It seems that any action, even just moving a card from here to there,
increases the memory usage and never let’s it go.

This is the inevitable consequence of keeping a list of user actions
in order to support undo or logging.


J.

Could it instead just write those into a file, and only access the file when the undo button is pressed?

Thus spake Filip:

Could it instead just write those into a file, and only access the file
when the undo button is pressed?

Possibly. It depends on whether anything else actively uses that
information. I’ll be happy to consider a patch for this should anyone`
submit one.


J.

I’d love to, if only I had any idea how to actually code that. Alas, I don’t.