Skip to Content
author's profile photo Former Member
Former Member

JCo IDoc program outofmemory error

Hi, I'm a new one in SDN and this is my first topic.

Now i use Jco-idoc jar to do some programs, and these programs are very sample: recieve IDOC requests,download to flat file and then do the other things with these files.

When i send a small IDOC request to this program manually (use WE19), all things look very well. But when i try to send a big one ,the program throw exception as below and the program crashed:

<b>Exception in thread "JCO.ServerThread-1" java.lang.OutOfMemoryError: requested 196370116 bytes for jchar in D:/BUILD_AREA/jdk142-update/ws/fcs/hotspot\src\share\vm\prims\jni.cpp. Out of swap space?</b>

I try to increase the JVM with "-Xms1024M -Xmx1024M -XX:NewSize=256M -XX:MaxNewSize=256M -XX:MaxPermSize=256M", but this error as same as before!

Is there buffer space limitation for JNI interface in sapjcorfc.dll? I guess. And the other question confused me. When i use EDI write this IDOC request to SAP local file, the file size only has about 20M and 92363 rows, why in my program recieve "<b>196370116 bytes</b>"?

I work in winxp, JSDK is j2se 1.4.2_08-b03, JCO version is 2.1.5, SAP Java Base IDoc Class Library version is 1.0.2, and SAP Java Connector IDoc Class Library version is 1.0.3.

Thank you!


Liu Hui

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 19, 2005 at 06:07 AM

    Hi Liu Hui,

    not sure if the JCo IDoc implementation adds lots of overhead, but depending on the used IDoc there might be some (did you try to profile it and check how much memory your smaller objects need?).

    If you're looking for flat files you might want to try substituting the IDoc server by a simple RFC server program that implements for example IDOC_INBOUND_ASYNCHRONOUS (or whichever function module you're using to send the data). This should be more efficient since at least the SDATA part is transferred as a String, which seems ok, since you're talking of flat files.

    Did you also just try running the server with parameter "-Xms1024M -Xms1024M"? Seems like you're making the Eden and Perm space quite large, which leaves less for the heap. I'd give it a shot without the other additions.

    Best wishes, harald

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi, harald

      I am not making the general test of what size sap can send thru IDOC. For we must extract some data from sap system of a bank in our project, and the size of data is too large(about over 5GB per datasource) to send to external system synchronally. we decide to build a JCo application so as to recieve the idoc request from sap EDI/ALE. we are aware of the large size of data, so we have to split them into many small packages, for example, 180,000 rows times 157byte/row is around 30MB per package, if we download to local file with EDI.

      your words make me clear why the overhead of IDOC so big. As you say, the EDI_DD40->SDATA will be filled with spaces upto to 1000 by itself, while we try to send a small segment that less than 1000 bytes.Since the case, we have to build a ABAP to tranlate the EDI_DD40->SDATA to string, and transfer it to our java service.

      thanks again ,harald.


  • author's profile photo Former Member
    Former Member
    Posted on Sep 15, 2005 at 03:12 AM

    Is there someone can respond? Thanks your help.

    Liu hui

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.