Out of memory error in smart client

Questions, answers, tips and ideas on Servoy Client

Out of memory error in smart client

Postby nromeou » Wed Jan 25, 2012 5:11 pm

Hi,
I've been having a memory issue with my application server.
I'm using Jasper Reports to make all my reports.
Only when I print a specially complex report my server crashes and reboots. The report is printed correctly but the moment any client takes action after printing the report everything crashes.
I tried updating the heap memory from 64 to 256 but it seems to have no effect at all.

This is the exception trown in servoy log.
Code: Select all
Exception in thread "2 way Server Acceptor" java.lang.OutOfMemoryError: unable to create new native thread
Filter trigger matched.  Restarting JVM.
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.addIfUnderMaximumPoolSize(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.execute(Unknown Source)
at com.servoy.j2db.rmi.ServerTwoWaySocketFactory$TwoWayServerSocket.run(ServerTwoWaySocketFactory.java:607)
at java.lang.Thread.run(Unknown Source)


I'm using Servoy 6.0 with Java 1.6.0_23.
Jasper version is 3.7.1 and my server runs with Win Server 2008

Any ideas??

Thanks for the help
nromeou
 
Posts: 215
Joined: Fri Sep 18, 2009 8:38 pm
Location: Montevideo, Uruguay

Re: Out of memory error in smart client

Postby ngervasi » Thu Jan 26, 2012 2:35 pm

It's your servoy application server that crashes or the smart client that requested the report?
What heap size did you increase? The smart client heap size or the application server heap size?
Nicola Gervasi
sintpro.com
SAN Partner
ngervasi
 
Posts: 1485
Joined: Tue Dec 21, 2004 12:47 pm
Location: Arezzo, Italy

Re: Out of memory error in smart client

Postby Thomas Parry » Thu Jan 26, 2012 3:11 pm

When you say complex report do you also mean very long in terms of pages output from JasperReports?
There is a known issue with in memory reports that are very lengthy. Search forum.
Tom Parry
Prospect IT
Java/C++/Servoy/Jasper Reports/Simulation/Service Applications
http://www.prospect-saas.biz
Thomas Parry
 
Posts: 498
Joined: Thu Jan 10, 2008 8:48 pm
Location: Ottawa, Canada

Re: Out of memory error in smart client

Postby nromeou » Thu Jan 26, 2012 4:46 pm

The server crashes, and i increased both heaps, the client one to 256 and the server one to 1024 maybe i need more. And yes it is a potentially very long in term pages report (could be like 300-400 pages long) ill look for that known issue.
nromeou
 
Posts: 215
Joined: Fri Sep 18, 2009 8:38 pm
Location: Montevideo, Uruguay

Re: Out of memory error in smart client

Postby Thomas Parry » Thu Jan 26, 2012 9:04 pm

Last edited by Thomas Parry on Fri Jan 27, 2012 2:57 pm, edited 1 time in total.
Tom Parry
Prospect IT
Java/C++/Servoy/Jasper Reports/Simulation/Service Applications
http://www.prospect-saas.biz
Thomas Parry
 
Posts: 498
Joined: Thu Jan 10, 2008 8:48 pm
Location: Ottawa, Canada

Re: Out of memory error in smart client

Postby nromeou » Fri Jan 27, 2012 2:27 pm

ive been reading about the virtualizer but i think im not getting how to use it quite right.
i added this to my parameters object
Code: Select all
o.VIRTUALIZER_TYPE = "file"; //possible options: file, swapFile, gZip
   o.PAGE_OUT_DIR = "\\\\desarrollo\\C\\Servoy6\\application_server\\server\\work\\";   


but what about the other parameters in the function call? how do i make this work?
nromeou
 
Posts: 215
Joined: Fri Sep 18, 2009 8:38 pm
Location: Montevideo, Uruguay

Re: Out of memory error in smart client

Postby ngervasi » Fri Jan 27, 2012 2:40 pm

Have a look at the docs for the different types of virtualisers, here's the code we are using:

Code: Select all
var _server_dir = plugins.jasperPluginRMI.reportDirectory
plugins.jasperPluginRMI.runReport(_fs,'sections_20.jasper',null,'view',{VIRTUALIZER_TYPE: 'swapFile', PAGE_OUT_DIR: _server_dir + '/tmp/', header1: _header1, header2: _header2, header_img: _header_img, language: globals.data_language},_locale);
Nicola Gervasi
sintpro.com
SAN Partner
ngervasi
 
Posts: 1485
Joined: Tue Dec 21, 2004 12:47 pm
Location: Arezzo, Italy

Re: Out of memory error in smart client

Postby nromeou » Fri Jan 27, 2012 3:18 pm

ive tryied this with both the swapFile and the file virtualizer but the server is still crashing afterwards, how can i assure myself that it is actually using the virtualizer? and if it is using it, could it be something else that makes my server crash?
nromeou
 
Posts: 215
Joined: Fri Sep 18, 2009 8:38 pm
Location: Montevideo, Uruguay

Re: Out of memory error in smart client

Postby Thomas Parry » Fri Jan 27, 2012 3:32 pm

Have you tried examining the log files?
Have you tried running your report from iReport (if possible?)
Tom Parry
Prospect IT
Java/C++/Servoy/Jasper Reports/Simulation/Service Applications
http://www.prospect-saas.biz
Thomas Parry
 
Posts: 498
Joined: Thu Jan 10, 2008 8:48 pm
Location: Ottawa, Canada

Re: Out of memory error in smart client

Postby nromeou » Fri Jan 27, 2012 3:37 pm

yeah the log gives me the same error i posted at the begging of the post and from iReport it runs just fine, i also get to see the report from servoy but after that when something else is done on the client or when another client connects it crashes
nromeou
 
Posts: 215
Joined: Fri Sep 18, 2009 8:38 pm
Location: Montevideo, Uruguay

Re: Out of memory error in smart client

Postby Thomas Parry » Fri Jan 27, 2012 4:59 pm

IF you run the report in the developer/debugger and stop it after the report has completed has it crashed then?
Perhaps you could wrap the plugins.jasperPluginRMI.runReport in a try catch block to determine if there is an exception raised then or if it is a little later in your processing.

Also: have you tried using the latest released plugin version ?
Tom Parry
Prospect IT
Java/C++/Servoy/Jasper Reports/Simulation/Service Applications
http://www.prospect-saas.biz
Thomas Parry
 
Posts: 498
Joined: Thu Jan 10, 2008 8:48 pm
Location: Ottawa, Canada

Re: Out of memory error in smart client

Postby nromeou » Mon Jan 30, 2012 3:16 pm

i put a breakpoint after the report and it didnt crashed by that time, also i didnt get any exception from try catch and im using the 3.1 b2 version of the plugin.
I realized that the virtualizer is working cause the virtualizer files appeared in the tmp folder, but its still crashing when another client connects or when something else is done. i believe that this problem is just appearing on the server side, cause on developer i havent been able to reproduce the crash.

ive searched
Code: Select all
java.lang.OutOfMemoryError: unable to create new native thread
and some recommend to increase the stack memory and some others to decrease it, i believe ive tryied both with no results but perhaps im doing it wrong
ive changed on the wrapper.config this
Code: Select all
# Maximum Java Heap Size (in MB)
wrapper.java.maxmemory=128


and also in the administrator page the client heap size, but nothing seems to work, im kinda lost and confused here :?
nromeou
 
Posts: 215
Joined: Fri Sep 18, 2009 8:38 pm
Location: Montevideo, Uruguay

Re: Out of memory error in smart client

Postby nromeou » Tue Jan 31, 2012 5:30 pm

ive just solved it!it seems that the server heap was never increased because i didnt reboot the server after modifying the wrapper, i had restarted app server but seems it was not enough.

Now its working fine but im still worried that it might break with some long report and several clients active, anyway i can keep on going now, thanks for the help
nromeou
 
Posts: 215
Joined: Fri Sep 18, 2009 8:38 pm
Location: Montevideo, Uruguay


Return to Servoy Client

Who is online

Users browsing this forum: No registered users and 13 guests