javax.management.RuntimeErrorException: java.lang.OutOfMemoryErr

166 views
Skip to first unread message

Greg Silverman

unread,
Apr 25, 2013, 5:55:24 PM4/25/13
to xnat_di...@googlegroups.com
I'm able to connect OsiriX to XNAT VM via the Gateway. I am also able to query data in XNAT just fine, and requests for retrieving images to XNAT are working, but before they complete I'm getting an out of memory error. Am unsure where the memory error is occurring, especially since my workstation has 1.27 GB free. Would this be on the VM (nothing relevant to this is showing up in catalina.out...).

Here is the log out from the Gateway: 

null
INFO - Apr 25, 2013 4:53:28 PM XNAT Gateway server v. Aug 2012 started
INFO - Start Server listening on 0.0.0.0:4008
INFO - handle - Socket[addr=/160.94.163.94,port=64846,localport=4008]
INFO - Socket[addr=/160.94.163.94,port=64846,localport=4008]
INFO - received AAssociateRQ
appCtxName: 1.2.840.10008.3.1.1.1/DICOM Application Context Name
implClass: 1.2.276.0.7238010.5.0.3.5.4
implVersion: OSIRIX
calledAET: XNATGATEWAY
callingAET: PACS
maxPDULen: 16384
asyncOpsWindow:
pc-1: as=1.2.840.10008.5.1.4.1.2.2.1/Study Root Query/Retrieve Information Model - FIND
ts=1.2.840.10008.1.2.1/Explicit VR Little Endian
ts=1.2.840.10008.1.2/Implicit VR Little Endian
ts=1.2.840.10008.1.2.2/Explicit VR Big Endian
ts=1.2.840.10008.1.2.4.90/JPEG 2000 Lossless Image Compression
ts=1.2.840.10008.1.2.4.91/JPEG 2000 Lossy Image Compression
ts=1.2.840.10008.1.2.4.70/JPEG Lossless, Non- Hierarchical, First-Order Prediction (Process 14 [Selection Value 1])
ts=1.2.840.10008.1.2.4.50/JPEG Baseline (Process 1)
ts=1.2.840.10008.1.2.4.51/JPEG Extended (Process 2 & 4)
ts=1.2.840.10008.1.2.5/RLE Lossless
ts=1.2.840.10008.1.2.4.100/MPEG2 Main Profile @ Main Level
INFO - sending AAssociateAC
appCtxName: 1.2.840.10008.3.1.1.1/DICOM Application Context Name
implClass: 1.2.40.0.13.1.1
implVersion: dcm4che-1.4.27
calledAET: XNATGATEWAY
callingAET: PACS
maxPDULen: 16352
asyncOpsWindow:
pc-1: 0 - acceptance
ts=1.2.840.10008.1.2/Implicit VR Little Endian
INFO - received [pc-1] 1:C_FIND_RQ with Dataset
class: 1.2.840.10008.5.1.4.1.2.2.1/Study Root Query/Retrieve Information Model - FIND
INFO - Apr 25, 2013 4:54:14 PM: REST query string:
/experiments?xnat:subjectdata/label=IT_IT*&columns=xnat:experimentdata/label,xnat:subjectdata/label,xnat:subjectdata/demographics[@xsi:type=xnat:demographicdata]/gender,xnat:subjectdata/demographics[@xsi:type=xnat:demographicdata]/dob,xnat:subjectdata/demographics[@xsi:type=xnat:demographicdata]/age,xnat:subjectdata/demographics[@xsi:type=xnat:demographicdata]/height,xnat:subjectdata/demographics[@xsi:type=xnat:demographicdata]/weight,xnat:subjectdata/demographics[@xsi:type=xnat:demographicdata]/ethnicity,xnat:experimentdata/visit_id,xnat:imagesessiondata/uid,project,xnat:experimentdata/project,xsitype,xnat:imagesessiondata/date,xnat:imagesessiondata/time
INFO - sending [pc-1] 1:C_FIND_RSP with Dataset
class: 1.2.840.10008.5.1.4.1.2.2.1/Study Root Query/Retrieve Information Model - FIND
status: ff00
INFO - sending [pc-1] 1:C_FIND_RSP
class: 1.2.840.10008.5.1.4.1.2.2.1/Study Root Query/Retrieve Information Model - FIND
status: 0
INFO - received A-RELEASE-RQ
INFO - sending A-RELEASE-RP
INFO - finished - Socket[addr=/160.94.163.94,port=64846,localport=4008]
INFO - closing connection - Socket[addr=/160.94.163.94,port=64846,localport=4008]
INFO - handle - Socket[addr=/160.94.163.94,port=64848,localport=4008]
INFO - Socket[addr=/160.94.163.94,port=64848,localport=4008]
INFO - received AAssociateRQ
appCtxName: 1.2.840.10008.3.1.1.1/DICOM Application Context Name
implClass: 1.2.276.0.7238010.5.0.3.5.4
implVersion: OSIRIX
calledAET: XNATGATEWAY
callingAET: PACS
maxPDULen: 16384
asyncOpsWindow:
pc-1: as=1.2.840.10008.5.1.4.1.2.2.1/Study Root Query/Retrieve Information Model - FIND
ts=1.2.840.10008.1.2.1/Explicit VR Little Endian
ts=1.2.840.10008.1.2/Implicit VR Little Endian
ts=1.2.840.10008.1.2.2/Explicit VR Big Endian
ts=1.2.840.10008.1.2.4.90/JPEG 2000 Lossless Image Compression
ts=1.2.840.10008.1.2.4.91/JPEG 2000 Lossy Image Compression
ts=1.2.840.10008.1.2.4.70/JPEG Lossless, Non- Hierarchical, First-Order Prediction (Process 14 [Selection Value 1])
ts=1.2.840.10008.1.2.4.50/JPEG Baseline (Process 1)
ts=1.2.840.10008.1.2.4.51/JPEG Extended (Process 2 & 4)
ts=1.2.840.10008.1.2.5/RLE Lossless
ts=1.2.840.10008.1.2.4.100/MPEG2 Main Profile @ Main Level
INFO - sending AAssociateAC
appCtxName: 1.2.840.10008.3.1.1.1/DICOM Application Context Name
implClass: 1.2.40.0.13.1.1
implVersion: dcm4che-1.4.27
calledAET: XNATGATEWAY
callingAET: PACS
maxPDULen: 16352
asyncOpsWindow:
pc-1: 0 - acceptance
ts=1.2.840.10008.1.2/Implicit VR Little Endian
INFO - received [pc-1] 1:C_FIND_RQ with Dataset
class: 1.2.840.10008.5.1.4.1.2.2.1/Study Root Query/Retrieve Information Model - FIND
INFO - Apr 25, 2013 4:54:20 PM: REST query string:
/experiments?xsiType=xnat:imageSessionData&xnat:imageSessionData/UID=1.2.840.113857.1129.121048.1410.152921&columns=xnat:imagescandata/uid,xnat:imagescandata/type,xnat:imagescandata/uid,xnat:imagescandata/modality,xnat:imagescandata/id,xnat:imagescandata/series_description,xnat:imagescandata/frames,
INFO - sending [pc-1] 1:C_FIND_RSP with Dataset
class: 1.2.840.10008.5.1.4.1.2.2.1/Study Root Query/Retrieve Information Model - FIND
status: ff00
INFO - sending [pc-1] 1:C_FIND_RSP
class: 1.2.840.10008.5.1.4.1.2.2.1/Study Root Query/Retrieve Information Model - FIND
status: 0
INFO - received A-RELEASE-RQ
INFO - sending A-RELEASE-RP
INFO - finished - Socket[addr=/160.94.163.94,port=64848,localport=4008]
INFO - closing connection - Socket[addr=/160.94.163.94,port=64848,localport=4008]
INFO - handle - Socket[addr=/160.94.163.94,port=64850,localport=4008]
INFO - Socket[addr=/160.94.163.94,port=64850,localport=4008]
INFO - received AAssociateRQ
appCtxName: 1.2.840.10008.3.1.1.1/DICOM Application Context Name
implClass: 1.2.276.0.7238010.5.0.3.5.4
implVersion: OSIRIX
calledAET: XNATGATEWAY
callingAET: PACS
maxPDULen: 16384
asyncOpsWindow:
pc-1: as=1.2.840.10008.5.1.4.1.2.2.2/Study Root Query/Retrieve Information Model - MOVE
ts=1.2.840.10008.1.2.1/Explicit VR Little Endian
ts=1.2.840.10008.1.2/Implicit VR Little Endian
ts=1.2.840.10008.1.2.2/Explicit VR Big Endian
ts=1.2.840.10008.1.2.4.90/JPEG 2000 Lossless Image Compression
ts=1.2.840.10008.1.2.4.91/JPEG 2000 Lossy Image Compression
ts=1.2.840.10008.1.2.4.70/JPEG Lossless, Non- Hierarchical, First-Order Prediction (Process 14 [Selection Value 1])
ts=1.2.840.10008.1.2.4.50/JPEG Baseline (Process 1)
ts=1.2.840.10008.1.2.4.51/JPEG Extended (Process 2 & 4)
ts=1.2.840.10008.1.2.5/RLE Lossless
ts=1.2.840.10008.1.2.4.100/MPEG2 Main Profile @ Main Level
INFO - sending AAssociateAC
appCtxName: 1.2.840.10008.3.1.1.1/DICOM Application Context Name
implClass: 1.2.40.0.13.1.1
implVersion: dcm4che-1.4.27
calledAET: XNATGATEWAY
callingAET: PACS
maxPDULen: 16352
asyncOpsWindow:
pc-1: 0 - acceptance
ts=1.2.840.10008.1.2/Implicit VR Little Endian
INFO - received [pc-1] 1:C_MOVE_RQ with Dataset
class: 1.2.840.10008.5.1.4.1.2.2.2/Study Root Query/Retrieve Information Model - MOVE
move dest: PACS
INFO - Apr 25, 2013 4:54:24 PM: Series retrieve request received
WARN - Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended.
ERROR - Unexpected exception:
javax.management.RuntimeErrorException: java.lang.OutOfMemoryError: Java heap space
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.rethrow(DefaultMBeanServerInterceptor.java:858)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.rethrowMaybeMBeanException(DefaultMBeanServerInterceptor.java:869)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:838)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:762)
at org.dcm4chex.archive.dcm.qrscp.MoveScp.c_move(MoveScp.java:163)
at org.dcm4cheri.net.ActiveAssociationImpl.run(ActiveAssociationImpl.java:235)
at org.dcm4cheri.util.LF_ThreadPool.join(LF_ThreadPool.java:174)
at org.dcm4cheri.net.ActiveAssociationImpl.run(ActiveAssociationImpl.java:157)
at org.dcm4cheri.server.DcmHandlerImpl.handle(DcmHandlerImpl.java:249)
at org.dcm4cheri.server.ServerImpl.run(ServerImpl.java:279)
at org.dcm4cheri.util.LF_ThreadPool.join(LF_ThreadPool.java:174)
at org.dcm4cheri.server.ServerImpl$1.run(ServerImpl.java:233)
at java.lang.Thread.run(Thread.java:680)
Caused by: java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:2786)
at java.io.ByteArrayOutputStream.toByteArray(ByteArrayOutputStream.java:133)
at org.nrg.xnat.gateway.XNATCMoveRsp.readZipBuf(XNATCMoveRsp.java:157)
at org.nrg.xnat.gateway.XNATCMoveRsp.retrieveSeries(XNATCMoveRsp.java:258)
at org.nrg.xnat.gateway.XNATCMoveRsp.retrieveSeries(XNATCMoveRsp.java:440)
at org.nrg.xnat.gateway.XNATGatewayServer.retrieveSeries(XNATGatewayServer.java:126)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:93)
at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:27)
at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:208)
at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:120)
at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:264)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:836)
... 10 more
INFO - sending [pc-1] 1:C_MOVE_RSP
class: 1.2.840.10008.5.1.4.1.2.2.2/Study Root Query/Retrieve Information Model - MOVE
status: c000
error comment: javax.management.RuntimeErrorException: java.lang.OutOfMemoryErr
INFO - received A-RELEASE-RQ
INFO - sending A-RELEASE-RP
INFO - finished - Socket[addr=/160.94.163.94,port=64850,localport=4008]
INFO - closing connection - Socket[addr=/160.94.163.94,port=64850,localport=4008]

Thanks in advance!

Greg--

-- 
Greg M. Silverman
Lead Developer Analyst
University of Minnesota


 

Mikhail Milchenko

unread,
Apr 26, 2013, 11:27:01 AM4/26/13
to xnat_di...@googlegroups.com
Try increasing available Java memory.
E.g. to increase max Java heap to 512M:

1 Under Windows, modify <gateway install dir>/start.bat
java.exe -Xms256m -Xmx512m -jar dist/gatewaye.jar

2 Under linux, modify <gateway install dir>/server.sh
java -Xms256m -Xmx512m -jar dist/gatewaye.jar $*

Herrick, Rick

unread,
Apr 26, 2013, 11:39:57 AM4/26/13
to xnat_di...@googlegroups.com

Yeah, to expand on this a little bit, the physical memory on your machine doesn't really come into play, since what's important in the case of any Java-based application is the amount of memory allocated to the JVM, which is what Misha’s script changes below set up for you.

 

As for the logging, XNAT Gateway runs separately from the XNAT as hosted in Tomcat. That means that the JVM settings on the Tomcat will have no effect on the gateway memory settings AND the logging’s not shared, so that’s why you’re not seeing any info in the catalina.out log file.

--
You received this message because you are subscribed to the Google Groups "xnat_discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xnat_discussi...@googlegroups.com.
To post to this group, send email to xnat_di...@googlegroups.com.
Visit this group at http://groups.google.com/group/xnat_discussion?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 




The material in this message is private and may contain Protected Healthcare Information (PHI). If you are not the intended recipient, be advised that any unauthorized use, disclosure, copying or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error, please immediately notify the sender via telephone or return mail.

Greg Silverman

unread,
Apr 29, 2013, 2:14:32 PM4/29/13
to xnat_di...@googlegroups.com
Mikhail,
It took me a bit to find the gateway install folder, but doing a "show package contents" seemed to do it. I will test this out ASAP and let you know the outcome.

Thanks! 

Greg--

Greg Silverman

unread,
Apr 29, 2013, 2:33:15 PM4/29/13
to xnat_di...@googlegroups.com
Same error. FWIW, I noticed that the dist directory with the jar was actually under a Gateway directory, so I added that to the jar' path as follows "Gateway/dist/gatewaye.jar" with the result of no change in behavior.  

How can I tell if the memory assigned to the JVM for the Gateway actually picked up the new config?

Thanks!

Greg--

Greg Silverman

unread,
May 10, 2013, 3:25:24 PM5/10/13
to xnat_di...@googlegroups.com
Still unable to resolve this memory issue. 

FWIW: My OS is Mac OS X Lion.

What next? Any ideas?

Thanks!

Greg--

Herrick, Rick

unread,
May 10, 2013, 4:23:38 PM5/10/13
to xnat_di...@googlegroups.com
Greg,

You should be able to do something like this on the machine running the Gateway:

ps aux | fgrep -i java

That should show all of the running java processes, along with any command-line parameters specified at application start-up. If you see the -Xmx512m parameter specified, go ahead and bump it up incrementally, e.g. by 256m at a time, and restart.

If you're still having trouble once you get up to to 1024m (and you've ascertained that the parameters are getting passed correctly), you can try to look a bit more deeply into what's going on within your JVM by connecting to it via jconsole:


If you get to that point, let me know and we can talk about what you might find in there. Optimally just bumping up the available heap space will do the trick.

One other catch is that, as you increase the available heap space and thus the size and number of objects referenced within the JVM, you may run into issues with permgen space. Roughly speaking, the heap is where you allocate the actual object storage, e.g. the stuff that's inside a string or other data object, and the permgen space is where you store information about those allocated objects, including address references, class definitions, and so on. So loading more classes and objects obviously means more information about those objects. If you start to run into permgen errors after you've increased the heap space, then it's time to get into the fun and exciting world of tuning your permgen settings.

Rick Herrick

Sr. Programmer/Analyst

Neuroinformatics Research Group

Washington University School of Medicine

(314) 827-4250


From: xnat_di...@googlegroups.com [xnat_di...@googlegroups.com] on behalf of Greg Silverman [g...@umn.edu]
Sent: Friday, May 10, 2013 2:25 PM

To: xnat_di...@googlegroups.com
Subject: [XNAT Discussion] Re: javax.management.RuntimeErrorException: java.lang.OutOfMemoryErr
--
You received this message because you are subscribed to the Google Groups "xnat_discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xnat_discussi...@googlegroups.com.
To post to this group, send email to xnat_di...@googlegroups.com.
Visit this group at http://groups.google.com/group/xnat_discussion?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Greg Silverman

unread,
May 10, 2013, 5:11:50 PM5/10/13
to xnat_di...@googlegroups.com
Hi Rick,
I JUST figured out the issue (I had '--' in front of one of the memory parameters instead of a single '-'... I guess it helped to step away from this problem for a couple of weeks). All is well now and I can query images in OsiriX through the gateway just fine. (Btw, I used jconsole to get the heap settings... I had forgotten the method below).

Thanks!

Greg--
Reply all
Reply to author
Forward
0 new messages