v2.1.0, bad_alloc, Out of Memory crash

If you have problems installing or running Algodoo, have found a bug or need in-game help - this is it!

v2.1.0, bad_alloc, Out of Memory crash

Postby middle_road » Sat Oct 26, 2013 10:54 pm

OUCH! over 12hrs of playing around with a scene, went to save, and received:
223817713 ms: - ERROR - std::bad_alloc caught! Cleaning memory...
223817713 ms: Freeing up memory...
223817727 ms: - ERROR - Failed to save scene "Algodoo/scenes/<FILENAME.phz": Out of memory!
<><><>
Workstation has 8GB of RAM (Win7/64) and I was saving every 20-30 minutes...
Scene file was nowhere to be found, this was bothersome.
I _DID_ recover the last saved - it was in the recycle folder - pheewww. There was no '_AUTOSAVE.PHN, anywhere.

I noticed in the logfiles that the '<CURRENT-FILENAME.phz' is moved to .trash...' during this error and subsquent crash.
Perhaps on a wishlist for the next rev, a '.BAK' schema could be added so as the latest saved version of the current file is not blown away on a major error such as this.

Logfiles attached.

_mr
system error.
Attachments
Logfile_previous--at_Crash_10-26.txt
(812.99 KiB) Downloaded 12 times
Logfile_After_Crash_10-26.txt
(19.83 KiB) Downloaded 14 times
middle_road
 
Posts: 8
Joined: Sun Aug 01, 2010 8:15 am

Re: v2.1.0, bad_alloc, Out of Memory crash

Postby electronicboy » Sun Oct 27, 2013 3:31 am

Shamefully, this issue is a catch-22 situation.

Saving a scene requires algodoo to call a few functions, which of course requires algodoo to use a tiny amount of memory which it doesn't have free, so it tries to clean up some ram, but fails. The best advice I can give is to keep an eye on ram usage, if you end in this situation again, try saving as .phn by prepending .phn onto the end of the filename when saving. Saving as .phn skips the process of trying to create a zip file in algodoo's ram area before dropping it to a file.

The issue isn't with algodoo itself exactly, but with the limitations of 32 bit applications only being able to address upto 2GB of ram. When it becomes logical to compile algodoo in a x64 edition, I will raise it up to the developers, however the issue comes into the fact that some libraries need to be sorted, and that the educational sector is at the stage where we can deploy the x64 edition with minor issues.
When asking for help, READ THE STICKIES!
electronicboy
 
Posts: 1694
Joined: Mon Aug 31, 2009 6:18 pm

Re: v2.1.0, bad_alloc, Out of Memory crash

Postby middle_road » Sun Oct 27, 2013 6:17 pm

Thanks EB for the reply. It didn't even come to mind that we were dealing with the limitations of 32-bit memory use.
And you're right with the main focus being on educational those folks may be on 32-bit platforms for a while.
Appreciate the tip of using the PHN extension vs. PHZ, I didn't know they were getting zipped up prior to saving, makes sense though.
I've taken to saving with the 4 digit suffix now, and cleaning up the extra files later. I think I was doing that back in 1.7 or 1.8 version.

_mr
middle_road
 
Posts: 8
Joined: Sun Aug 01, 2010 8:15 am


Return to Help / Bug reports

Who is online

Users browsing this forum: No registered users and 9 guests