Page 1 of 2

Object Heap

Posted: Sat Jul 24, 2010 9:04 am
by MerreM
Hi,
Trying to get the demo up to have a loop about the site but upon starting I get;
[java] Could not create Java virtual Machine
[java] Could not reserve enough space for object heap

How on earth do I set larger memory allocation on a windows machine?

Any help appreciated.
Thanks.

Re: Object Heap

Posted: Sat Jul 24, 2010 9:25 am
by jefffischer
This message is basically telling you that the Java VM was unable to allocate enough memory to launch the requested application. Are you taxed for available RAM on this machine? The demo (java -jar broadleaf-demo-launcher-[version].jar) already is configured to attempt to allocate the amount of memory it needs when it's launched. You should have around 1G of available RAM when you launch the demo. The reason for this is that an instance of the demo application is being launched, and an instance of the admin application - each requiring ~500M. You may have to shut down other applications to free up more RAM, or install more physical RAM on the machine.

Re: Object Heap

Posted: Sat Jul 24, 2010 10:16 am
by MerreM
3 GB should be enough no?
1.85 is free at the moment...
*Edit: Thanks for the fast response

Re: Object Heap

Posted: Sat Jul 24, 2010 10:39 am
by jefffischer
Agreed - that sounds like enough RAM. You might try rebooting the machine. It could be that not enough contiguous RAM is available (your memory may be too fragmented at the moment for some reason).

Re: Object Heap

Posted: Sat Jul 24, 2010 10:59 am
by MerreM
Still no luck with that, could it be the Virtual Machine settings?
If so, any idea how to change them?

Re: Object Heap

Posted: Sat Jul 24, 2010 11:59 am
by jefffischer
Unfortunately, it could be any number of things that are restricting Java's ability to allocate the chunk of contiguous memory. This makes diagnosis a little open-ended. I was able to find these threads on Oracle's Java forum:

http://forums.sun.com/thread.jspa?forum ... ID=5427852

http://forums.sun.com/thread.jspa?forum ... ID=5431636

It won't be a setting that you change in Java. It's something external to Java that's restricting memory in a way that Java can't allocate a CONTIGUOUS amount of RAM for the task at hand. There seems to be some talk that some virus scanners can interfere in this way and they suggest turning off any virus scanners temporarily to see if the problem is alleviated. Other than that - I'm afraid I won't be of much help.

Re: Object Heap

Posted: Mon Jul 26, 2010 1:04 pm
by MerreM
Hi,
Thanks for the support, OK so I thought about it a bit, decided to use Net Beans to run it as I've never had a problem running things through it before.
Opened the Maven Project, so far so good, but I can't get the damn thing to run now.

[ERROR]From file: E:\BroadleafCommerce-1.1.0-GA-with-dependencies\src\site\BroadleafCommerceDemoLauncher\pom.xml
[ERROR]Reason: Result of cmd.exe /X /C ""E:\apache\apache-maven-2.2.1\hsqldb\hsqldb\1.8.0.10\hsqldb-1.8.0.10.jar org.broadleafcommerce.demo.Launcher" execution is: '1'.

Any idea what to do now?

Re: Object Heap

Posted: Mon Jul 26, 2010 1:11 pm
by jefffischer
Sorry - I don't. I haven't tried to run the standalone demo from NetBeans before. In addition, the output you show does indicate there was a problem (result code of '1'), however there's no stack trace, so it's hard to diagnose.

Re: Object Heap

Posted: Tue Jul 27, 2010 5:50 am
by MerreM
at org.broadleafcommerce.demo.Launcher.main(Launcher.java:27)


Being;
project.executeTarget("jetty-start");

Does that help?

Re: Object Heap

Posted: Tue Jul 27, 2010 10:42 am
by MerreM
Fixed that problem, back to Object Heap.
Oh the joys.