---------------------------------------- > Date: Mon, 15 Feb 2010 07:07:50 -0800 > From: > To: [email protected] > Subject: [iText-questions] RandomAccessFileOrArray file load in memory > > > Hello, > > i'm confront to big problem of out.memory error on server when i have a lot > of user who want get a pdf file from tiff file.
This may be considered OT for itext, and maybe someone has a better answer, but after all my comments about resource usage re pdf machinations- short answer see if anyone at sun.com has similar issues and solutions for other server things and try subbing into itext for your own needs, unless Bruno has canned implementation alternatives. For requests that just take a long time, you may have to change your paradigm and notify user later via email or something when result is done. These are not specific to itext or pdf. > > I use Itext 1.2.7 > > Is it possible to Override the RandomAccessFileOrArray for replace the byte > arrayIn[] by a temporary file ? Generally memory management in java is quite limited and long before you run out of memory you would want to do things like maximize low level cache hits etc. However, there may be something on sun.com as this is likely to be a common issue when you scale java apps ( I've never bothered to look mysef but it woldn't just be about itext) and "you have the source code" so you can take alt approaches. Code is never really platform independent and implementation details make of break real-world utility ( hence issues with pdf resource needs and benefits). Also note if all the users are translating the same image, in-memory caching of single objects not duplicated hundreds of times, can be a big savings. You need a sharing mechanism in this case. A "scalable itext" or something like that would probably be a commercial product :) Assuming you have zero virtual memory right now , this is just going to slow things down even more ( preusmably your current "out of memory" condiution has alrady been addressed with increased heap size to the point of doing a lot of VM thrashing ) and it could get to the point where each requests takes forever as the whole system thrashes between requests ( you can probably write a simple equation to determine the number of executing requests given the arrival rate and processing time with proc time increasing with number of active requests). You might just be better off limiting the number of active requests and queing the rest and notify user when done if currently you are trying to return a complete pdf to user via the requesting http connection. > > or use temporary file when the file is more than 5 ko for example. > > Thank you, > -- > View this message in context: > http://old.nabble.com/RandomAccessFileOrArray-file-load-in-memory-tp27595180p27595180.html > Sent from the iText - General mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, > Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW > http://p.sf.net/sfu/solaris-dev2dev > _______________________________________________ > iText-questions mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/itext-questions > > Buy the iText book: http://www.1t3xt.com/docs/book.php > Check the site with examples before you ask questions: > http://www.1t3xt.info/examples/ > You can also search the keywords list: http://1t3xt.info/tutorials/keywords/ _________________________________________________________________ Hotmail: Powerful Free email with security by Microsoft. http://clk.atdmt.com/GBL/go/201469230/direct/01/ ------------------------------------------------------------------------------ SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW http://p.sf.net/sfu/solaris-dev2dev _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
