Memory running out randomly

My game suddenly started coming up with this error at specific points:

Is this something I can fix by increasing any specific artificial memory limits? If so can someone give me the full list of memory limits I can raise in Glulx so that I can be sure that my game runs smoothly?

Specific points, you say? Repeatable issues? Could it be related to your code at those specific points?

Most are points where a character or object gets moved somewhere. I think the overall game is capping out the memory and stuff like this is pushing it over. These points are nothing special and they worked fine every time I tested them until recently.

There should be more error messages along with that one. (A “***…***” message.) Are you seeing them?

The only memory limit setting that affects game memory is “Use dynamic memory allocation…” as described in chapter 20.2. All the rest are for the compiler, not the game.

But this may not be a problem that can be fixed by increasing that limit. It could be a library bug; it could be a memory leak of some kind which will run out no matter what the limit is. Can’t tell without more information.

Hmm, okay, I tried to increase the dynamic memory some more, but I can’t because if I do it wants me to add more to MAX_STATIC_DATA, and if I do that the game won’t compile because MAX_STATIC_DATA is already literally at the maximum for Inform 6L38. I’m not sure what else to do though. Here are my memory settings anyway, I’ve been bumping them to try and fix the problems:

Use MAX_ARRAYS of 9999999.
Use ALLOC_CHUNK_SIZE of 9999999.
Use MAX_CLASSES of 9999999.
Use MAX_DICT_ENTRIES of 999999.
Use MAX_OBJECTS of 999999.
Use MAX_PROP_TABLE_SIZE of 99999999.
Use MAX_STATIC_DATA of 99999999.
Use MAX_SYMBOLS of 999999.
Use MAX_VERBSPACE of 9999999.
Use SYMBOLS_CHUNK_SIZE of 9999999.

Use maximum things understood at once of at least 99.
Use dynamic memory allocation of at least 999999.[/code]

There’s another tab under results called Console - when you compile and check that, is it actually max static data that is running out? It will tell you for sure there. The error text I know uses one thing as an example which may not be the actual thing that’s running out.

None of those settings have anything to do with a run-time memory error.

Try copying your source and pasting into a new project with defaults and see what it says on compile. If it gives you that “max static data” error, go to the Results tab and see if it tells you what’s running over.

If it won’t compile at all, or crashes on run you might have fed it an infinite loop somewhere. That can happen if you do something like “Instead of fooing the frob, try barring the frob. … Check barring the frob: if the score is 0: try fooing the frob instead.”

Ah, I was looking at the console. All of those settings happened because at some point the game complained it didn’t have enough memory in that slot, so I added the setting and upped it a bit. If I take them out it will just tell me that one of them is too low.

I think I’m going to have to wait until it gives me an in-game error again and then paste it back here.

Ok, I think I’ve worked it out! It was actually bits of script for Dynamic Objects that I missed. I think I’m just going to remove that entire mod and try to do without. Shame though, it made my ammo shop infinite. Thanks for your help guys, at least I learnt some stuff here. :smiley:

This is why it’s suggested you don’t model multitudes of stuff like ammo (or leaves or snowflakes). Use a value.

No, it didn’t. It’s worth pointing this out for the next person who tries Dynamic Objects. It can be useful but it does not permit unlimited objects in a game.