# java.lang.OutOfMemoryError: Java heap space

**URL:** <https://forum.servoy.com/t/java-lang-outofmemoryerror-java-heap-space/14229>\
**Category:** Classic Servoy\
**Created:** [June 30, 2011, 10:55am UTC](https://forum.servoy.com/t/java-lang-outofmemoryerror-java-heap-space/14229 "2011-06-30T10:55:47Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![swingman](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/swingman/32/4536_2.png) [@swingman](https://forum.servoy.com/u/swingman)\
**Post date:** [June 30, 2011, 10:55am UTC](https://forum.servoy.com/t/java-lang-outofmemoryerror-java-heap-space/14229/1 "2011-06-30T10:55:47Z")

</div>

Hi all,

We are running out of heap space. The server is grinding to a halt. Users compaining.  
What do I do? Increase heap space or is there something else going on?

C

Server Information  
Servoy version 5.2.8 -build 1016  
Port used by RMI Registry: 1099  
Repository version 38 (B7D004BD-1867-4F81-BE78-6F412AC55069)  
Current time: Thu Jun 30 11:45:42 BST 2011  
Uptime: 21 hours 18 minutes 58 seconds  
Server ID: 31FEA7CA-047D-4F92-8422-D2805469F3CF

User Information  
Logged in as: chrisb

JVM Information  
java.vm.name=Java HotSpot™ 64-Bit Server VM  
java.version=1.6.0\_24  
java.vm.info=mixed mode  
java.vm.vendor=Apple Inc.

Operating System Information  
os.name=Mac OS X  
os.version=10.6.7  
os.arch=x86\_64

System Information  
Heap memory: allocated=258880K, used=251077K, max=258880K  
None Heap memory: allocated=120412K, used=74933K, max=180224K

---

<div class="post-metadata">

**Author:** ![swingman](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/swingman/32/4536_2.png) [@swingman](https://forum.servoy.com/u/swingman)\
**Post date:** [June 30, 2011, 11:02am UTC](https://forum.servoy.com/t/java-lang-outofmemoryerror-java-heap-space/14229/2 "2011-06-30T11:02:31Z")

</div>

How do I increase the heap space on Mac OS X?

---

<div class="post-metadata">

**Author:** ![ROCLASI](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/roclasi/32/4371_2.png) [@ROCLASI](https://forum.servoy.com/u/ROCLASI)\
**Post date:** [June 30, 2011, 11:13am UTC](https://forum.servoy.com/t/java-lang-outofmemoryerror-java-heap-space/14229/3 "2011-06-30T11:13:21Z")

</div>

Hi Christian,

In servoy\_server.sh you can change the -Xmx setting to lets say 512m.

---

<div class="post-metadata">

**Author:** ![swingman](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/swingman/32/4536_2.png) [@swingman](https://forum.servoy.com/u/swingman)\
**Post date:** [June 30, 2011, 11:26am UTC](https://forum.servoy.com/t/java-lang-outofmemoryerror-java-heap-space/14229/4 "2011-06-30T11:26:43Z")

</div>

Have done now. Thanks.

---

<div class="post-metadata">

**Author:** ![swingman](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/swingman/32/4536_2.png) [@swingman](https://forum.servoy.com/u/swingman)\
**Post date:** [June 30, 2011, 11:42am UTC](https://forum.servoy.com/t/java-lang-outofmemoryerror-java-heap-space/14229/5 "2011-06-30T11:42:25Z")

</div>

The documentation is useless:

[http://wiki.servoy.com/display/public/D … e+Settings](http://wiki.servoy.com/display/public/DOCS/Memory+and+Performance+Settings)

does not tell you that it is the -Xmx setting and where you have to change it.  
You have to know…

---

<div class="post-metadata">

**Author:** ![pbakker](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@pbakker](https://forum.servoy.com/u/pbakker)\
**Post date:** [June 30, 2011, 11:47am UTC](https://forum.servoy.com/t/java-lang-outofmemoryerror-java-heap-space/14229/6 "2011-06-30T11:47:39Z")

</div>

More elaborate docs on this are found here: [http://wiki.servoy.com/display/public/D … the+server](http://wiki.servoy.com/display/public/DOCS/Tuning+the+server)

Will make sure there’s a better link between the two entries for the 6.0 docs.

Paul

---

<div class="post-metadata">

**Author:** ![ROCLASI](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/roclasi/32/4371_2.png) [@ROCLASI](https://forum.servoy.com/u/ROCLASI)\
**Post date:** [June 30, 2011, 12:00pm UTC](https://forum.servoy.com/t/java-lang-outofmemoryerror-java-heap-space/14229/7 "2011-06-30T12:00:05Z")

</div>

Hi Paul,

I looked at that page too but it doesn’t cover Mac/Linux setups at all. Only windows.  
I know Servoy 6 comes with a wrapper on Mac but I don’t believe this is the case with 5.x.  
Perhaps you can add that too.

---

<div class="post-metadata">

**Author:** ![pbakker](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@pbakker](https://forum.servoy.com/u/pbakker)\
**Post date:** [June 30, 2011, 12:38pm UTC](https://forum.servoy.com/t/java-lang-outofmemoryerror-java-heap-space/14229/8 "2011-06-30T12:38:47Z")

</div>

I don’t see anything in this thread that refers to running it as a service and the docs I point to discuss the memory settings both for running the server through the servoy\_server.bat/.sh and through the service wrapper.

Paul

---

<div class="post-metadata">

**Author:** ![ROCLASI](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/roclasi/32/4371_2.png) [@ROCLASI](https://forum.servoy.com/u/ROCLASI)\
**Post date:** [June 30, 2011, 1:41pm UTC](https://forum.servoy.com/t/java-lang-outofmemoryerror-java-heap-space/14229/9 "2011-06-30T13:41:41Z")

</div>

> pbakker:  
> I don’t see anything in this thread that refers to running it as a service …

Other that it all about server and users are on it ? That usually means (or should mean) it’s not launched manually.

> pbakker:  
> and the docs I point to discuss the memory settings both for running the server through the servoy\_server.bat/.sh and through the service wrapper.

True, you do touch on it in one line. I guess I was expecting more of an example like you do with the wrappers. But that is me.

---

<div class="post-metadata">

**Author:** ![Robert\_Huber](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@Robert\_Huber](https://forum.servoy.com/u/Robert_Huber)\
**Post date:** [July 2, 2011, 8:03pm UTC](https://forum.servoy.com/t/java-lang-outofmemoryerror-java-heap-space/14229/10 "2011-07-02T20:03:11Z")

</div>

Hi Robert

What do you mean exactly by saying …Servoy 6 comes with a wrapper on Mac… What is this wrapper and what does it do?

> ROCLASI:  
> I know Servoy 6 comes with a wrapper on Mac but I don’t believe this is the case with 5.x.

Regards, Robert

---

<div class="post-metadata">

**Author:** ![ROCLASI](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/roclasi/32/4371_2.png) [@ROCLASI](https://forum.servoy.com/u/ROCLASI)\
**Post date:** [July 2, 2011, 8:19pm UTC](https://forum.servoy.com/t/java-lang-outofmemoryerror-java-heap-space/14229/11 "2011-07-02T20:19:20Z")

</div>

Hi Robert,

When you install Servoy 6 Server it installs a ‘service’ directory in the application\_server directory, just like it always would on Windows.  
In here you find the wrapper.conf and a shell script ‘ServoyServer’ (and a few other files).  
The wrapper.conf will be used by Server and holds a bunch of parameters like the memory parameters.

The ServoyServer script is a nice utility to install/remove the service into Launchd and to start/stop/restart it when it’s installed as a service.  
So no more tinkering with plists ![:)]( "Smile")

---

<div class="post-metadata">

**Author:** ![Robert\_Huber](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@Robert\_Huber](https://forum.servoy.com/u/Robert_Huber)\
**Post date:** [July 2, 2011, 8:55pm UTC](https://forum.servoy.com/t/java-lang-outofmemoryerror-java-heap-space/14229/12 "2011-07-02T20:55:53Z")

</div>

Hi Robert

That sounds really good, nearly to good to be true ![;-)]( "Wink")

---

<div class="post-metadata">

**Author:** ![pbakker](https://avatars.discourse-cdn.com/v4/letter/p/a4c791/32.png) [@pbakker](https://forum.servoy.com/u/pbakker)\
**Post date:** [July 4, 2011, 8:40am UTC](https://forum.servoy.com/t/java-lang-outofmemoryerror-java-heap-space/14229/13 "2011-07-04T08:40:52Z")

</div>

Watch out for the release notes of the next 6.0 RC, as that will contain the relevant info on this feature (up till now the feature was sort of in the installer already, but not yet finalized, hence no mentions yet in the Release Notes).

Paul
