Out of Memory Issues

Problem with out of memory warning. Cannot save module or game, stupid out of memory just keeps popping up. Supposedly a known issue and supposedly solved. See pics. Having to use Windoze task manager to shut down Vassal just NOT on.

.

To what do you have the maximum heap set for this module?

I don’t understand what you’re trying to say with ā€œjust NOT on.ā€

In any case, after you killed Vassal, what did you do next?

This is a British/Australian English expression indicating that something is wholly unsatisfactory–in this case, being left with no recourse but to kill VASSAL via the Task Manager vs having a ā€œcleanā€ exit.

Ah. Thanks. That just leaves what did he do after killed Vassal.

1 Like

Originally 6000MB. Task manager was showing usage at circa 6200 MB. I changed the JVM max to 6500MB.

After killing Vassal I relaunched.

Please post an errorLog from a run where you had this problem.

Jeez Joel, where do you think I’ve got an errorlog from several days ago. Can we have a small grip on reality, and/or real life, here.

If you can reproduce the problem, please post an errorLog. If you can’t, well, then you’re no longer having the problem…

2 Likes

One could argue, as outlined in How to report problems, that you should have attached the errorLog when reporting the problem in the first place. In fact, the errorLog provides more useful information than a screenshot of the problem.

You should be able to reproduce the problem and then capture the errorLog - not difficult in ā€œreal lifeā€.

Remember, you need to help others so that they can help you.

Did increasing the allocated memory for the virtual machine solve your issue?

Vassal using ~6GB of memory sounds like you’ve stumbled upon a memory leak triggered by the module you are using - which you should also have reported, btw - and the errorLog may point people in-the-know in the right direction.

The problem of shutting down Vassal when it hits a memory leak is quite general of Java due to the garbage collection done in the virtual machine and due to how Java handles the exception stack. It is not easy to work around that in an application.

Please help others help you by providing enough information (see How to report problems) to facilitate a diagnostic. Thanks.

Yours,
Christian

2 Likes

Dear Mr Spock. Love to know what planet you live on. Vulcan mayhap.

How many of us, players & module developers, know the ins and outs of ā€˜how to report problems’? How many of us care?

Did I not state that an errorlog was not available. Screen shot is what you get.

Yes, one could argue whatever, but in real life, I was more concerned about closing the application, not (ever) reproducing the problem.

Also, the ā€˜errorlog’ is more than something that ā€˜just’ records ā€˜errors’. It records EVERYTHING, regardless. It is NOT an ERRORLOG per se, it is a record of everything the current session of Vassal does. Refreshes, et al. It also appears to reset after hard restart. So anything that happened prior to that restart is lost. Solution? Staggered ā€˜errorlogs’. Maybe same date but different time stamps.

If I’ve ā€˜stumbled upon a memory leak problem’ then that is NOT my problem, it is a Vassal problem. How can a Vassal module have a memory leak problem? A memory leak problem rather tends to indicate a Vassal issue, not a module issue.

I would really like to help others so that they can help me, but some of those ā€˜others’ actually need to provide constructive advice.

Finally, why is there a JVM MAX heap memory ā€˜limit’? Surely there is inbuilt capability/capacity for JAVA to allocate/use whatever is necessary for RAM. Java is (surely) not that ā€˜stupid’? Specifying a limit can be archaic?

Joel, If I get the problem again of course I’ll post an error log. If I can.

Given that you posted your question to the Technical Support & Bugs sub-forum, I think it is fair to think that you are asking for help to solve a problem. As such, it would behove you to familiarise yourself with How to report problems (click the link) so that you can get the best possible help.

In real life, most people that ask for help do so with a bit of humility and with an understanding that they may need to provide some feedback.

As for closing down Vassal when it is out of memory: That is a technical challenge due to how Java works internally. When that error happens, and if Vassal doesn’t shut down in reasonable amount of time, your best option is to kill the application - e.g.,

pkill -9 java

True, the errorLog does record a lot of stuff - though not everything - and most of that stuff is relevant when diagnosing a problem.

As for staggered log files: Yes, that could be done. However, there’s a number of challenges

  • when do you cycle the log?
  • given that Vassal typically is running several processes (module manger, players, editors), who decides when to do the cycle?
  • also, the since the Vassal module manager may run for a very long time, how to make sure logs persists?
  • how long should log run for?
  • how large a cycle is tolerable? up to 10 logs?, indefinite number of logs?

Quite clearly, if a memory leak is the issue at fault, it is a problem for you - hence your post. That is not to say that you must be the one to solve it, but you can help others solve your (and possibly other user’s) problem by providing some information.

Memory leaks happen because of data and modules are data. Some data may provoke a bug that other data will not provoke. Hence, a particular module may provoke the problem even if the bug is in the Vassal code base. The issue could be in the module if the module data is erroneously structured. In all cases, it is important to know what data you were using when the problem occurred, if the problem is to be diagnosed and solved.

The constructive ā€˜advice’ (rather, a request for information) is that you provide more information so that the problem can be diagnosed and possibly fixed - for yours and other’s sake. If you will not or cannot provide that information, it makes it much harder for others to help you.

Of course, if you think providing the information is irrelevant, then I will take it that you have enough expertise to make that judgement. If that is the case, then that would likely mean you also have the expertise to solve the issue. In all other cases, your request for help seems more like grumbling - like a true grognard :slight_smile: Given you have raised similar concerns in the past ( Vassal RAM Usage), I tend to think it is the latter - especially since you say you only ever dabbled with Fortran IV (aka Fortran 66 - no heap at all).

It is not uncommon in environments that uses garbage collection - like Java and .NET does - to limit an applications heap memory size. That’s because garbage collection means that objects may be kept alive longer than really needed. If an application allocates a lot of objects (memory), then it can make sense to force garbage collection by setting a max heap memory size.

Other platforms, such as Python and modern C++ (post C++11), deals with the issue by reference counting and freeing memory when the object is no longer used. Both methods have their pros and cons.

That said, there’s no way a Vassal process should reasonably take up ~6GB of memory. It really sounds like there’s something in Vassal holding on to objects (memory) and not freeing them when they are no longer needed. Letting Java allocate as much memory as it likes will likely not solve the issue, because the needed memory will continue to grow until the OS runs out of virtual memory. Joel has already pointed this out in the past

If you can provide some information, then someone might be able to figure out what is going on and fix the issue - to the benefit of yourself and other Vassal users. Without the information, it is much harder to diagnose and solve the issue - and everyone - including yourself - suffers.

So please, have some courtesy when asking for help and provide as much information as possible so that others may better help you.

Yours,
Christian

2 Likes

Java is indeed that stupid. You have to provide a maximum amount of memory for it to use when you start it. This is one of the many reasons we won’t continue to use Java beyond V3.

Regarding providing an errorLog from a failed run: The information I need to solve your problem is there with high probability. I’m not the one having the problem, though, so idgaf if you’re unwilling to provide it. I will carry on regardless.

But it does puzzle me when people take this approach. When you talk with your mechanic or doctor because you have a problem you want them to solve, do you refuse to answer their questions about your problem? Does that get you a better result? It’s quite strange.

1 Like

Joel, If there is no errorlog from a failed run, then that is that. Sorry about that.

Back to the main issue reported. The endless loop of - out of memory, please fix and restart, repeated ad nauseum. Cannot exit to restart. Thus endless loop syndrome. There really has to be a better way of handling this OOM condition. Mayhap a ā€˜do you wish to send the errorlog file to the Vassal Team’ and then it shuts down. Or even send the errorlog file and then shut down.

Every run writes an errorLog. If you have just killed a failed run, there will be an errorLog in the directory mentioned here.

The reason you are having to do this is that Java is running out of memory and you’re restarting without having fixed the problem. Doing this over and over is user error, not a bug.

The errorLog will tell us what the max heap that Java was started with actually was; if we have that, we can suggest what you should do next.

2 Likes

Looked there. Nothing pertinent. That was before my last post, so there is NO errorlog from the failed run. I do believe I’ve stated what the JVM max heap size was at the time 6000MB. The system through a hissy fit with Vassal & Module sitting at circa 6200MB.

What I do see ATM is errorLog-3.7.15 dated 8/4/25 and errorLog-3.7.16 dated 27/8/25.

Why would a 3.7.15 errorLog still be there?

The reason you are having to do this is that Java is running out of memory and you’re restarting without having fixed the problem. Doing this over and over is user error, not a bug.

By restarting you mean having to use Windows Task Manager to force program closure? Instead of Vassal failing to allow closure because there is an error and then automatically sending an error report with the errorLog file attached.

When you have another failed run, please post the errorLog from that.

The errorLog will show what max heap the JVM was actually started with, which may differ from what you think it was started with.

Each version writes its own logs. errorLog-3.7.15 is still there from the last time you ran 3.7.15.

Yes, and then starting Vassal and opening the module again without making any adjustments.

We don’t want automatic error reports to be generated when the user runs out of memory, as this situation is not a bug.

I did up the JVM max heap size. Stop making assumptions or forgetting what I have previously posted.

While running out of memory may not be a bug, the inability to shut Vassal down, via the standard quit or clicking on the X option, is a bug. No software should enter a loop of advising the user of an issue and then refusing to accept a normal quit/click on close (X) command.

You say you changed the setting, but that does not mean the JVM used it. An errorLog would show what actually occurred. I have nothing further to contribute here until you post an errorLog from a failed run.

Agreed, but there is no way to fix this in V3, nor would I do further work on V3 even if there were. V4 will not behave this way.