Reputation: 11
I am running a Netlogo model in v. 4.0.5 and the model uses too much memory and then quits. I have tried to change the memory limits per the instructions in the user manual to no avail. The program doesn't even open when I make increase the memory. I can't run it through RNetLogo because it no longer supports version 4. I know this topic has been touched on before but the previous responses have not resolved my issue. I've changed the output to table instead of spreadsheet as well. I'd like to up the memory to at least 3GB. Any help would be greatly appreciated!
Upvotes: 1
Views: 74
Reputation: 30453
By default, NetLogo 4.0 (which dates all the way back to 2007!) runs in 32-bit mode on Mac OS X, which limits your heap size to 2G.
You have two choices:
Choice 1: Upgrade to NetLogo 5.0 or later. These versions run in 64-bit mode by default.
Choice 2: Launch NetLogo 4.0 from the command line, instead of using the provided app bundle. Info.plist will be bypassed, so you specify the heap size you want on the command line instead. These commands seem to work on my Mac:
export JAVA_HOME=$(/usr/libexec/java_home -v 1.6)
cd /Applications/NetLogo\ 4.0.5
java -server -d64 -Xmx4096M -jar NetLogo.jar
After launching NetLogo this way, in the System tab of the About NetLogo dialog I see:
Java HotSpot(TM) 64-Bit Server VM 1.6.0_65 (Apple Inc.; 1.6.0_65-b14-466.1-11M4716)
operating system: Mac OS X 10.10.3 (x86_64 processor)
Java heap: used = 8 MB, free = 176 MB, max = 3640 MB
note "64-Bit Server" and the higher-than-default heap max value.
It might also be possible to somehow edit the app bundle to launch in 64-bit mode; I don't know.
Upvotes: 1
Reputation: 541
Before you add more memory I'd double check my program for nested loops. It's so easy in netlogo to make 4 or 5 layers of nested loops without even realizing it, and this can really slow the program down. are you sure you've completely optimized your program?
Upvotes: 0