Java heap space

Alright, so I have a pretty major problem at the moment…

Now, I load my model and make it into .j30, and that’s all fine (it’s a pretty large file, which I guess is causing the problem). I then add it to a scene, which also works, but when I then play around with the scene, add lights, particle-emmitters etc. and try to save the scene… oh boy. The saving process goes for a few seconds, and then the poor little monkey gets his head blown up :explode: with a message saying “Error: Java heap space.”
(Thought I should mention it now so I don’t forget: If you need the full log of the error with all the classes, I can post that as well. I just don’t have it right now.)
Well, I wait for some minutes, with the “Saving scene” bar still running, and nothing actually happening. It ends with me having to force-quit the IDE, and force-quit the saving progress… which means, that when I attempt to open the scene in the SceneExplorer… “Can’t open scene file.” And boom, that’s all the “hard” work I put into those particle emitters and such gone.

Now, I guess this is caused by Java running out of memory, so I allocated a bit more memory to java in my computer settings (something like 1GB to 2GB if I remember correctly) as well as in the “Run” settings of the project, but I’m guessing that the “Run” settings don’t actually affect the SceneExplorer?

This might also be caused by my world units having been through a bit of inflation… they are currently at a rate of approximately 1 unit = 0.1 metres (or so). Can this cause a problem as well, or is it just that the model (the top floor of a house, complete with furniture etc.) is too heavy?

Any help appreciated, and if you have any questions just ask :slight_smile:

You have to modify the jmonkeyplatform.conf file:

@normen said: You have to modify the jmonkeyplatform.conf file:

https://wiki.jmonkeyengine.org/legacy/doku.php/sdk:troubleshooting

Well, I’m guessing the line I should change is this one:

[java]default_options="–branding jmonkeyplatform -J-Xms24m -J-Xmx512m -J-XX:PermSize=128m -J-XX:MaxDirectMemorySize=2048m -J-Dsun.zip.disableMemoryMapping=true -J-[/java]

What do you recommend as settings to render the SceneExplorer usable? That 24M and 128M seem very small… I have a 6GB RAM on my computer, by the way.

@SCOMS said: Well, I'm guessing the line I should change is this one:

[java]default_options="–branding jmonkeyplatform -J-Xms24m -J-Xmx512m -J-XX:PermSize=128m -J-XX:MaxDirectMemorySize=2048m -J-Dsun.zip.disableMemoryMapping=true -J-[/java]

What do you recommend as settings to render the SceneExplorer usable? That 24M and 128M seem very small… I have a 6GB RAM on my computer, by the way.

That’s because you have no clue what those parameters mean. It might be worth looking at the docs before randomly setting values. For example, 128m PermSize is pretty huge in fact.

Edit: also, if those are really the settings you have then your model must be too large. Or we’d need to know more about the error but if I sound frustrated it’s because I seem to have to say that 50 times a day.

@pspeed said: That's because you have no clue what those parameters mean. It might be worth looking at the docs before randomly setting values. For example, 128m PermSize is pretty _huge_ in fact.

Edit: also, if those are really the settings you have then your model must be too large. Or we’d need to know more about the error but if I sound frustrated it’s because I seem to have to say that 50 times a day.

Alright, well, I haven’t messed around with the settings, that’s how they were from the start. I would have guessed the default would be rather low, as it quite often is with many programs, but I guess not.

If you want to see the error log, then I’ll post that. Otherwise, I’ll just have to reduce the model size and similar. Thanks for your help, anyway.

@SCOMS said: Alright, well, I haven't messed around with the settings, that's how they were from the start. I would have guessed the default would be rather low, as it quite often is with many programs, but I guess not.

If you want to see the error log, then I’ll post that. Otherwise, I’ll just have to reduce the model size and similar. Thanks for your help, anyway.

Well, the web is literally dripping with documentation on this subject. I suspect if you put any of those parameters into google then you’d get pages and pages of links to explanations.

This one you are probably most interested in is: -Xmx512m

…if it’s really a heap space and not a direct memory error then your j3o must be pretty crazy to cause this issue.