Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Regarding the IText API

 
muthu bharathi
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Everybody,

I tried to merge two pdf documents using itext api. it's working fine for small size of documents. i tried to merge a 40MB document with 30KB document, it shows the out of memory exception. i increased the heap size of java also.. still i am getting the same error.

1. What is the limitation of file size while merging using itext api. i want to confirm is there any limitiations in itext api

2. Please provide me the sample source or guide me how to merge the 40MB document with 30Kb document.

i am awaiting for your earlier response....

--
With Regards,
M. Bharathi
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34672
367
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How much memory did you increase it to?
 
muthu bharathi
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jeanne

Thanks a lot for your valuable response


First i tried to merge 38MB pdf files with 30KB pdf files. i got the out of memory exception.

1. I need upto 100 MB pdf files this is my scenario.

Please let me know if we have any other possibilities to merge the large size of pdf files...


--
Thanks & Regards,
M. Bharathi
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you running out of regular heapspace or the permgen space? Have you tried profile the memory usage with the visualjvm tool?
 
muthu bharathi
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jeanne,

Thanks for your response.

we have 4GB RAM machine and we set the java heap space is 1024. still we are getting the same exception. we cannot merge the two large size of pdf documents. I need some more clarifications:

1. how much of java heap space memory(maximum limit of JVM heap space) if i have a 4GB RAM machine.

2. Is there any calculations/limitations to set the heap size based on the RAM memory.

3. We set the java heap space through Environmental variables. please confirm me it is correct or not and i used the following line to set the heap space JAVA_OPTS=-Xms1024.

Please clarify the above as soon as possible

--
Regards,
Bharathi


 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1.) It depends on the Operating System and the underlying architecture (32 or 64 bit) you'll need to do some research for your combination

2.) Not easily that I'm aware of, you could write a script to detect your machine's RAM and adjust accordingly before you fire the Java process I suppose.

3.) That's minimum memory and it needs to be -Xms1024M you also might want to give it a max -Xmx2048M for example, as long as your java command is picking up the JAVA_OPTS that should work fine
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic