GeeCON Prague 2014*
The moose likes Other Open Source Projects and the fly likes Regarding the IText API Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Regarding the IText API" Watch "Regarding the IText API" New topic
Author

Regarding the IText API

muthu bharathi
Ranch Hand

Joined: Dec 10, 2008
Posts: 97
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

Joined: May 26, 2003
Posts: 30595
    
154

How much memory did you increase it to?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
muthu bharathi
Ranch Hand

Joined: Dec 10, 2008
Posts: 97
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

Joined: Jun 24, 2003
Posts: 3274
    
    5

Are you running out of regular heapspace or the permgen space? Have you tried profile the memory usage with the visualjvm tool?


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
muthu bharathi
Ranch Hand

Joined: Dec 10, 2008
Posts: 97
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

Joined: Jun 24, 2003
Posts: 3274
    
    5

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
 
wood burning stoves
 
subject: Regarding the IText API