Bug - Won't Fix Unexpected error while transferring items to store

Bale

Minion
Sometimes at the end of an ascension when I sell off my extra stuff, I get an unexpected error. This only happens when I've got a lot to transfer using batch_close();

Code:
Transferring items to store (request 1 of 24)...
Items offered up for sale.
Transferring items to store (request 2 of 24)...
Items offered up for sale.
Transferring items to store (request 3 of 24)...
Items offered up for sale.
Transferring items to store (request 4 of 24)...
Items offered up for sale.
Transferring items to store (request 5 of 24)...
Items offered up for sale.
Transferring items to store (request 6 of 24)...
Items offered up for sale.
Transferring items to store (request 7 of 24)...
Items offered up for sale.
Transferring items to store (request 8 of 24)...
Items offered up for sale.
Transferring items to store (request 9 of 24)...
Items offered up for sale.
Transferring items to store (request 10 of 24)...
Items offered up for sale.
Transferring items to store (request 11 of 24)...
Items offered up for sale.
Transferring items to store (request 12 of 24)...
Items offered up for sale.
Transferring items to store (request 13 of 24)...
Items offered up for sale.
Transferring items to store (request 14 of 24)...
Items offered up for sale.
Transferring items to store (request 15 of 24)...
Items offered up for sale.
Transferring items to store (request 16 of 24)...
Items offered up for sale.
Transferring items to store (request 17 of 24)...
Items offered up for sale.
Transferring items to store (request 18 of 24)...
Items offered up for sale.
Transferring items to store (request 19 of 24)...
Items offered up for sale.
Transferring items to store (request 20 of 24)...
Unexpected error, debug log printed.
This has happened before, but I'm finally reporting it.

The debug log is attached.
 

Attachments

Code:
Unexpected error, debug log printed.
class java.lang.OutOfMemoryError: Java heap space
The debug log seems to be pretty clear. Someone who actually understands how java works should chime in though.
 
Yep. Java ran out of memory. Difficult to debug and perhaps not mafia's problem. First, on the upper right of the main screen there is the memory counter of the form used/available next to a "button" that will do garbage collection. What are those numbers? The second should be constant so you can report it even if the error doesn't reoccur.

Three possible areas of solution. The first is "don't do that". Saving server hits is good but you may have to accept that getting the job done is more important than saving server hits. So you might consider removing the batch commands or perhaps using batch_close after every 15 requests.

The second is your environment. You are running out of heap space. I cannot quickly find how much heap space Java decides to allocate as the default but you could either add more memory to your system or override the default by a command line parameter. Tell me your OS and how you launch mafia if you want me to research details for you.

Third possibility is that mafia is doing something it shouldn't. My guess, however, is that each item to be batched requires mafia to allocate memory for the request and that memory cannot be freed or released until the request is executed, i.e. the batch_close() is encountered.
 
Maybe the best solution would be for me to batch_close(); batch_open(); as soon as there are 110 items to send to the mall... It's a little annoying, but it would probably be a sufficient work-around.
 
Maybe the best solution would be for me to batch_close(); batch_open(); as soon as there are 110 items to send to the mall... It's a little annoying, but it would probably be a sufficient work-around.

That would be one recommendation although the fact that 110 seems to be the magic number as opposed to 137 or 69 is a function of your particular environment.
 
The magic number for my system seemed to be at over 209. I'm calling it at 110 just to be on the very safe side. ;)
 
Any calls you can make to see how much memory is left? If it's displayed in the GUI, can commands like the batch query it and do a close/open when it gets below 10% remaining?
 
Back
Top