Skip to main content
chris hawk_448
Inspiring
February 19, 2019
Answered

Webservice call results in Java heap space error

  • February 19, 2019
  • 2 replies
  • 3895 views

Migrating to CF2018, we have noticed that our webservice calls are quickly pegging system resources and resulting in java heap space out of memory errors after a few minutes.  Increasing memory allocation results in longer periods of time before erroring out, but similar results.

Pointing at java 8 and moving tools.jar into the WEB-INF/lib directory shows successful results with near instantaneous response.

Has anyone else seen this or have any idea why java 10 would be showing this issue?

This topic has been closed for replies.
Correct answer chris hawk_448

I will give that a try and get back to you.


Update:

I uninstalled CF2018, reinstalled using the current installer with update 2, and then began to test using a minimally configured setup (mostly default settings).  After quite a bit of debugging, I believe I have narrowed down the problem to two things:

1.  It appears that we have a bug in our code that has been known to cause problems consuming CF published webservices.  This is outlined in the following doc, but curiously wasn't an issue for us using java 8...

https://tracker.adobe.com/#/view/CF-3581691

2.  We have been using the javax.servlet jar file for some time now.  With java 10, this seems to be causing our webservice calls to being running up the CPU and increasing java heap until a heap error occurs.  Removing this jar fixes the problem.  I have yet to determine if an updated jar is necessary.

2 replies

Charlie Arehart
Community Expert
Community Expert
February 19, 2019

Chris, before digging any further, can you confirm simply what your cf max heap size is in cf2018 vs what you're migrating from? I've seen many miss that they had raised it on the previous version but not on the new one--and the default of 1g may simply not be enough for your code and load.

If they are the same in the new and old cf instance, tell us next what the previous version was. There may be an explanation for increases heap use, especially between cf9 and earlier as compared to cf10 and later.

/Charlie (troubleshooter, carehart. org)
chris hawk_448
Inspiring
February 19, 2019

We have been running at 512m for CF11.  After running into this issue, I experimented with raising it to 768m (heap error after about 16mins) and even up to 2048m (heap error after about 30mins).  Just for reference, pointing CF2018 at java 8 gives me a page response in about 3 seconds.

chris hawk_448
Inspiring
February 19, 2019

We also tried creating an extremely basic webservice call to just return "Hello World", just in case the return file size was part of the issue.  The heap space error that returned was similar, but didn't return the java.util.Arrays references:

"Information","ajp-nio-8017-exec-4","02/19/19","11:48:15",,"coldfusion.jsp.CompilationFailedException: Errors reported by Java compiler:     The system is out of resources.  Consult the following stack trace for details.  java.lang.OutOfMemoryError: Java heap space  at jdk.zipfs/jdk.nio.zipfs.ZipFileSystem.iteratorOf(ZipFileSystem.java:406)  at jdk.zipfs/jdk.nio.zipfs.ZipDirectoryStream.iterator(ZipDirectoryStream.java:69)  at java.base/java.nio.file.FileTreeWalker$DirectoryNode.<init>(FileTreeWalker.java:78)  at java.base/java.nio.file.FileTreeWalker.visit(FileTreeWalker.java:310)  at java.base/java.nio.file.FileTreeWalker.next(FileTreeWalker.java:373)  at java.base/java.nio.file.Files.walkFileTree(Files.java:2752)  at jdk.compiler/com.sun.tools.javac.file.JavacFileManager$ArchiveContainer.<init>(JavacFileManager.java:523)  at jdk.compiler/com.sun.tools.javac.file.JavacFileManager.getContainer(JavacFileManager.java:319)  at jdk.compiler/com.sun.tools.javac.file.JavacFileManager.list(JavacFileManager.java:715)  at jdk.compiler/com.sun.tools.javac.code.ClassFinder.list(ClassFinder.java:730)  at jdk.compiler/com.sun.tools.javac.code.C.... "

BKBK
Community Expert
Community Expert
February 19, 2019

Could you show us the code and the stack trace or error messages? Java 10 is significantly different from Java 8. See for example the Java version history.

chris hawk_448
Inspiring
February 19, 2019

Webservice call:

<cfinvoke webservice ="#variables.baseURL#/#####/OrgList.cfc?wsdl"

  method ="GetOrgList"

  username="xxxxxxx"

  password="xxxxxxx"

  returnVariable="UIOrgList">

</cfinvoke>

Webservice.log:

"Information","ajp-nio-8017-exec-3","02/18/19","17:24:33",,"Starting Web service request."

"Information","ajp-nio-8017-exec-3","02/18/19","17:24:33",,"Creating Web service proxy {url='https://##########/#####/OrgList.cfc?wsdl'}"

"Information","ajp-nio-8017-exec-9","02/18/19","17:24:36",,"Using Axis 1 framework for servicing the web service request to the endPoint https://##########/#####/OrgList.cfc."

"Information","ajp-nio-8017-exec-9","02/18/19","17:24:36",,"Deploying the CFC https://##########/#####/OrgList.cfc as a web service."

"Information","ajp-nio-8017-exec-3","02/18/19","17:24:36",,"Downloaded the wsdl https://##########/#####/OrgList.cfc?wsdl"

"Information","ajp-nio-8017-exec-3","02/18/19","17:24:36",,"Using Axis 1 for consuming the service https://##########/#####/OrgList.cfc?wsdl."

"Information","ajp-nio-8017-exec-3","02/18/19","17:39:20",,"coldfusion.jsp.CompilationFailedException: Errors reported by Java compiler:     The system is out of resources.  Consult the following stack trace for details.  java.lang.OutOfMemoryError: Java heap space  at java.base/java.util.Arrays.copyOf(Arrays.java:3688)  at java.base/java.util.ArrayList.grow(ArrayList.java:237)  at java.base/java.util.ArrayList.grow(ArrayList.java:242)  at java.base/java.util.ArrayList.add(ArrayList.java:467)  at java.base/java.util.ArrayList.add(ArrayList.java:480)  at jdk.zipfs/jdk.nio.zipfs.ZipFileSystem.iteratorOf(ZipFileSystem.java:408)  at jdk.zipfs/jdk.nio.zipfs.ZipDirectoryStream.iterator(ZipDirectoryStream.java:69)  at java.base/java.nio.file.FileTreeWalker$DirectoryNode.<init>(FileTreeWalker.java:78)  at java.base/java.nio.file.FileTreeWalker.visit(FileTreeWalker.java:310)  at java.base/java.nio.file.FileTreeWalker.next(FileTreeWalker.java:373)  at java.base/java.nio.file.Files.walkFileTree(Files.java:2752)  at jdk.compiler/com.sun.tools.javac.file.JavacFileManager$ArchiveContainer.<init>(JavacFileManager.java:523)  at jdk.compiler/com.s.... "