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 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