Java Out of Memory Errors Servoy 6

Questions, answers, tips and ideas on Servoy Client

Java Out of Memory Errors Servoy 6

Postby Kahuna » Thu Sep 01, 2011 4:48 pm

After an upgrade of a client server system from Servoy 5 to 6 ALL of the client machines have failed with Java out of memory errors.

Our app has changed minimally - really only what was necessary to upgrade to 6. These memory errors are being fired as soon as a user attempts to open a Smart Client. The PC's have all been using Java v14 (old I know but they have it on LOTs of PC's), but since this was perfectly adequate for V5 it has come as a big surprise to find it impossible to run the Clients - especially since there has been no change in the memory allocations of the Clients or the Server (we have been using the default heap size). These PC's have been rebooted and completely disconnected for periods to ensure they were clean and any stored memory was cleared, and yet the memory error would arise before the app was even started.

The solution on one test PC was the installation of Java v21, and this seems to have resolved the issue for the moment. My concern is that this is only a temporary fix however - and before we get the client to roll-out this version to dozens of PC's we need to be sure that our system is not some-how filling some memory allocation? We have stress tested this single operational Smart Client connection today without error but my lack of knowledge on these matters has me concerned that we are going to get to a point where this one on v21 will run out of memory too.

Is there any experience of this out there in Servoy Land? Suggestions would be welcome as to how to either satisfy ourselves that the memory error is gone in Java 21 or how to test for issues that may contribute to this.

Code: Select all
Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
                             at java.io.ObjectInputStream$HandleTable.grow(Unknown Source)
                             at java.io.ObjectInputStream$HandleTable.assign(Unknown Source)
                             at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
                             at java.io.ObjectInputStream.readObject0(Unknown Source)
                             at java.io.ObjectInputStream.readObject(Unknown Source)
                             at java.util.HashMap.readObject(Unknown Source)
                             at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
                             at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                             at java.lang.reflect.Method.invoke(Unknown Source)
                             at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
                             at java.io.ObjectInputStream.readSerialData(Unknown Source)
                             at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
                             at java.io.ObjectInputStream.readObject0(Unknown Source)
                             at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
                             at java.io.ObjectInputStream.readSerialData(Unknown Source)
                             at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
                             at java.io.ObjectInputStream.readObject0(Unknown Source)
                             at java.io.ObjectInputStream.readObject(Unknown Source)
                             at java.util.concurrent.ConcurrentHashMap.readObject(Unknown Source)
                             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                             at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                             at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                             at java.lang.reflect.Method.invoke(Unknown Source)
                             at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
                             at java.io.ObjectInputStream.readSerialData(Unknown Source)
                             at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
                             at java.io.ObjectInputStream.readObject0(Unknown Source)
                             at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
                             at java.io.ObjectInputStream.readSerialData(Unknown Source)
                             at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
                             at java.io.ObjectInputStream.readObject0(Unknown Source)
                             at java.io.ObjectInputStream.readObject(Unknown Source)
01-09-2011 07:37:54 com.servoy.j2db.util.Debug error
SEVERE: Failure error in the tunnel, trying to reconnect
java.io.IOException: Input stream closed
                             at com.sebster.tunnel.impl.j.j(j.java:64)
                             at com.sebster.tunnel.impl.j.d(j.java:189)
                             at com.sebster.tunnel.impl.j.a(j.java:122)
                             at com.sebster.tunnel.impl.cc.a(cc.java:17)
                             at com.sebster.tunnel.impl.gc.a(gc.java:35)
                             at com.sebster.tunnel.impl.yc.run(yc.java:42)
                             at java.lang.Thread.run(Unknown Source)
01-09-2011 07:37:54 com.sebster.tunnel.multiplexer.rmi.ClientMultiplexedRmiSocketFactoryProvider onFail
SEVERE: rmi multiplexer failed
java.io.IOException: Input stream closed
                             at com.sebster.tunnel.impl.j.j(j.java:64)
                             at com.sebster.tunnel.impl.j.d(j.java:189)
                             at com.sebster.tunnel.impl.j.a(j.java:122)
                             at com.sebster.tunnel.impl.cc.a(cc.java:17)
                             at com.sebster.tunnel.impl.gc.a(gc.java:35)
                             at com.sebster.tunnel.impl.yc.run(yc.java:42)
                             at java.lang.Thread.run(Unknown Source)
Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
                             at java.io.ObjectInputStream$HandleTable.grow(Unknown Source)
                             at java.io.ObjectInputStream$HandleTable.assign(Unknown Source)
                             at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
                             at java.io.ObjectInputStream.readObject0(Unknown Source)
                             at java.io.ObjectInputStream.readObject(Unknown Source)
                             at java.util.HashMap.readObject(Unknown Source)
                             at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
                             at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                             at java.lang.reflect.Method.invoke(Unknown Source)
                             at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
                             at java.io.ObjectInputStream.readSerialData(Unknown Source)
                             at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
                             at java.io.ObjectInputStream.readObject0(Unknown Source)
                             at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
                             at java.io.ObjectInputStream.readSerialData(Unknown Source)
                             at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
                             at java.io.ObjectInputStream.readObject0(Unknown Source)
                             at java.io.ObjectInputStream.readObject(Unknown Source)
                             at java.util.concurrent.ConcurrentHashMap.readObject(Unknown Source)
                             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                             at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                             at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                             at java.lang.reflect.Method.invoke(Unknown Source)
                             at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
                             at java.io.ObjectInputStream.readSerialData(Unknown Source)
                             at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
                             at java.io.ObjectInputStream.readObject0(Unknown Source)
                             at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
                             at java.io.ObjectInputStream.readSerialData(Unknown Source)
                             at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
                             at java.io.ObjectInputStream.readObject0(Unknown Source)
                             at java.io.ObjectInputStream.readObject(Unknown Source)
01-09-2011 07:38:01 com.servoy.j2db.util.Debug error
SEVERE: Failure error in the tunnel, trying to reconnect
java.io.IOException: Input stream closed
                             at com.sebster.tunnel.impl.j.j(j.java:64)
                             at com.sebster.tunnel.impl.j.d(j.java:189)
                             at com.sebster.tunnel.impl.j.a(j.java:122)
                             at com.sebster.tunnel.impl.cc.a(cc.java:17)
                             at com.sebster.tunnel.impl.gc.a(gc.java:35)
                             at com.sebster.tunnel.impl.yc.run(yc.java:42)
                             at java.lang.Thread.run(Unknown Source)
01-09-2011 07:38:01 com.sebster.tunnel.multiplexer.rmi.ClientMultiplexedRmiSocketFactoryProvider onFail
SEVERE: rmi multiplexer failed
java.io.IOException: Input stream closed
                             at com.sebster.tunnel.impl.j.j(j.java:64)
                             at com.sebster.tunnel.impl.j.d(j.java:189)
                             at com.sebster.tunnel.impl.j.a(j.java:122)
                             at com.sebster.tunnel.impl.cc.a(cc.java:17)
                             at com.sebster.tunnel.impl.gc.a(gc.java:35)
                             at com.sebster.tunnel.impl.yc.run(yc.java:42)
                             at java.lang.Thread.run(Unknown Source)
(Servoy Version: 6.0.7 Win XP / 7 - SQL Server 2008 R2)
Ian Cordingley (Kahuna)
Kahuna
 
Posts: 1235
Joined: Thu Oct 26, 2006 1:39 am
Location: 1/2 NE UK 1/2 Olvera Spain

Re: Java Out of Memory Errors Servoy 6

Postby patrick » Thu Sep 01, 2011 8:49 pm

Java 1.4? Your are kidding. We have just reached Java 7?!

Anyway, how much memory do you give to clients?
Patrick Ruhsert
Servoy DACH
patrick
 
Posts: 3688
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Re: Java Out of Memory Errors Servoy 6

Postby patrick » Thu Sep 01, 2011 8:51 pm

btw: I think Servoy does not even support Java 1.4...
Patrick Ruhsert
Servoy DACH
patrick
 
Posts: 3688
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Re: Java Out of Memory Errors Servoy 6

Postby ROCLASI » Thu Sep 01, 2011 9:04 pm

patrick wrote:btw: I think Servoy does not even support Java 1.4...

Since Servoy 3.5.0 Servoy Server requires Java 5 and up (due to the use of Tomcat 6). Client can still use Java 1.4.
Robert Ivens
SAN Developer / Servoy Valued Professional / Servoy Certified Developer

ROCLASI Software Solutions / JBS Group, Partner
Twitter: @roclasi
--
ServoyForge - Building Open Source Software.
PostgreSQL - The world's most advanced open source database.
User avatar
ROCLASI
Servoy Expert
 
Posts: 5354
Joined: Thu Oct 02, 2003 9:49 am
Location: Netherlands/Belgium

Re: Java Out of Memory Errors Servoy 6

Postby Kahuna » Fri Sep 02, 2011 8:31 am

Gents I believe it is Java 1.6_014 where as we are developing against Java 1.6_024 or have I gotten my numbers mixed up?

As for Client memory we have the default size. Which was working fine with Servoy 5 and yet not Servoy 6. Nothing as far as we know has changed in the Servoy Server install or the solution. So why memory failures now and not 3 days ago on the same machines??
(Servoy Version: 6.0.7 Win XP / 7 - SQL Server 2008 R2)
Ian Cordingley (Kahuna)
Kahuna
 
Posts: 1235
Joined: Thu Oct 26, 2006 1:39 am
Location: 1/2 NE UK 1/2 Olvera Spain

Re: Java Out of Memory Errors Servoy 6

Postby pbakker » Fri Sep 02, 2011 9:25 am

If the only change was an upgrade to Servoy 6, I guess the CLient in Servoy 6 might just require a bit of more memory and prior to you upgrading the clients were just not hitting the limit and now they do.

Best to check the memory consumption of the clients in the old situation (See help > about in the smart client).

If there's a huge difference in memory consumption in the old situation and the maximum you've have in the new situation, then it should be investigated further. But if in the old situation the clients were consuming almost the max allowed memory, you might just have to upp the servoy.maxClientHeap setting a bit.

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Re: Java Out of Memory Errors Servoy 6

Postby Kahuna » Fri Sep 02, 2011 9:55 am

pbakker wrote:If the only change was an upgrade to Servoy 6, I guess the CLient in Servoy 6 might just require a bit of more memory and prior to you upgrading the clients were just not hitting the limit and now they do.

Best to check the memory consumption of the clients in the old situation (See help > about in the smart client).

If there's a huge difference in memory consumption in the old situation and the maximum you've have in the new situation, then it should be investigated further. But if in the old situation the clients were consuming almost the max allowed memory, you might just have to upp the servoy.maxClientHeap setting a bit.

Paul


Thanks Paul - we dont have the opportunity to test this environment in Servoy 5 anymore, so checking the memory useage is not possible.

So I guess the sensible thing for us to do is increase the default Servoy server Client heap size.

Q. What size would you consider safe to set this to in Servoy 6 Server - currently its at the default?

If the memory size is causing this problem then why would upgrading the Java to v21 on the specific PC's result in this memory error going away?

Q. Do you think there is a potential that this operational PC will eventually fill the Java memory, or is it a case of if it runs correctly now it will continue to do so? (sorry for the dumb question but I'm struggling to make sense of this situation).
(Servoy Version: 6.0.7 Win XP / 7 - SQL Server 2008 R2)
Ian Cordingley (Kahuna)
Kahuna
 
Posts: 1235
Joined: Thu Oct 26, 2006 1:39 am
Location: 1/2 NE UK 1/2 Olvera Spain

Re: Java Out of Memory Errors Servoy 6

Postby pbakker » Fri Sep 02, 2011 10:27 am

Memory management & Java is always a tricky subject: In Java you always specify the maximum amount of memory the Java process is allowed to use and if at runtime the Java process requires more than the maximum, it'll bomb out.

So, set it to a very high value? Well, that might impact performance and also prevent apps from being started on machines that don't have that much memory...

So, it all comes down to tuning...

Where to start? What value to use for the maxClientHeap? It really depends on the application.... Most apps will run just fine with the default settings, but if you extend Servoy with a whole bunch of plugins and beans, memory usage increases. It's also how the app is designed: I've seen solutions where due to the design they loaded >150Mb of just data into memory and kept hanging on to it...

So, not knowing your solution giving you a save number is quite impossible, but if you currently have it on default, I'd say give it a try with 512 (assuming that all client machines have at least 1Gb of memory available)

As to why you get the OutOfMemory exceptions with one Java version and not with the other: Can be either that there's an issue in the specific Java version causing it to use way more memory than needed or it can be that the newer version is just a bit more optimized so it used just a little less memory, preventing you from running into the OutOfMemory exceptions.

Hope this helps a bit. For more reading: http://wiki.servoy.com/display/DOCS/Memory+Management

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands


Return to Servoy Client

Who is online

Users browsing this forum: No registered users and 2 guests