Hello,
I built the test configuration as discussed in posting Problems starting up mec AS2 on Mac OS X. It works fine with some small test files.
But I'm testing for a big german retailer and so big files are also interessting for me, due to some sales reports, which can easily be around 100 MB.
I tried to transfer a pdf file with 18 MB and I got pretty fast an OutOfMemory exception with the comment "Java heap ...".
So what are the file size limits?
Do someone has any experiences on this sector?
Best regards
Tobias Hergenroether
Tobias,
The java heap size is set by default to 16MB I think. To pass more memory to the VM just start the program with the command
java -Xmx192M -Xms92M -classpath "xxx" "de.mend.."This allows the VM to use max 192MB, min 92MB of memory, you could set it even to more memory than you have in your machine, then your OS will swap to your hard disc if the physical memory limit is reached.
If you use the as2.exe on windows OS please modify the file as2.lax to allow the VM to allocate more memory.
Add the following lines and you should not run out of memory that fast (512MB setting):
# LAX.NL.JAVA.OPTION.JAVA.HEAP.SIZE.INITIAL
# -----------------------------------------
# Defines the initial heap size
lax.nl.java.option.java.heap.size.initial=92m
# LAX.NL.JAVA.OPTION.JAVA.HEAP.SIZE.MAX
# -------------------------------------
# Defines the maximum heap size
lax.nl.java.option.java.heap.size.max=512m
Regards
Heller
Heller,
I tried to follow your instructions regarding the as2.lax file with build 17 on Windows.
When I set the parameters like you suggested, then the AS2.exe doesn't start at all.
If I set only
lax.nl.java.option.java.heap.size.initial=64m
and don't use "lax.nl.java.option.java.heap.size.max" in the as2.lax file at all, then the AS2.exe comes up, but I am not sure if the heap limit really was increased.
Do you have any idea what might cause this ?
And can you please as an alternative post the whole command line how to invoke AS2 with "java -Xmx192M -Xms92M ..." because I am not sure what to set the classpath to and how the "de.mend.." is supposed to continue.
best regards,
Andy
Andy,
I have no idea why the modification in the lax file doesn't work in your case. Are you really sure there is no type?
Anyway this windows batch file should do the job:
@echo off
set CLASSPATH="mec_as2.jar";"jetty\start.jar"
call :appendJarsAndZips jlib
call :appendJarsAndZips jlib\jms
:RunIt
java -Xmx192M -Xms92M -classpath %CLASSPATH% de.mendelson.comm.as2.AS2
:appendToCP
set CLASSPATH=%CLASSPATH%;%1
goto :EOF
:appendJarsAndZips
for %%D in (%1\*.jar,%1\*.zip) do call :appendToCP "%%D"
goto :EOF
Regards
Heller
I rechecked everything in the lax file and it just won't start.
But with the batch file you posted I was able to set higher memory limits and I can now receive even large files without problems.
many thanks,
Andy
Hi,
I have experienced the following:
I have increased the heap to 1024. This allows me to send files larger than 5 MB. I have tired to send a file of size 118 MB. This does not work, which actually sounds strange! Any idea?
thanks, nabster
nabster,
it really might be a problem of m-e-c as2 because copies of the raw and encrypted data are stored in mem.
On the other hand it seems to be a possible solution to use bouncycastle b138 which is part of m-e-c as2 b21. I am not sure about this point but I found the following thread in the bouncycastle dev forum. Could you give it a try?
http://www.bouncycastle.org/devmailarchive/msg08153.html
Just setting more and more heap mem to the VM seems to have limits, please have a look at these threads:
http://forum.java.sun.com/thread.jspa?threadID=768356&messageID=9542948
http://forum.java.sun.com/thread.jspa?threadID=645335&messageID=4346478
Regards
Heller