On Tue, Apr 18, 2006 at 07:39:44PM -0500, a a wrote:

> some one can explain me for what is 
> 
> public JRFileVirtualizer(int maxSize,
>                          java.lang.String directory)
> 
> Parameters:
>     maxSize - the maximum size (in JRVirtualizable
> objects) of the paged in cache.
>     directory - the base directory in the filesystem
> where the paged out data is to be stored

The maxSize parameter specifies how many of the JRPrintPage
objects are kept in memory.  The rest are virtualized to
separate files in the temp directory.   For example, if the
report ended up taking 5000 pages, and maxSize was set to 100,
then only 100 of the JRPrintPage objects would actually be
held in memory, and the rest would be virtualized to the
filesystem using a least-recently-used caching algorithm.

If you can increase the heap size of your Java VM with the
-Xmx400m switch for example (to give a max of 400Megabytes
to the JVM), and keep the maxSize large, say around 250,
then you will avoid virtualizing any pages as long as the
report does not have more than 250 pages.  This will speed
up the creation of the JasperPrint object becuase it will
not need to serialiize and deserialize all of the elements
on the virtualized pages.

> which are the cache page? 
> 
> which better for to spend less memory, use a
> JRFileVirtualizer with a JasperPrint in memory object,
> and after call 
> 
> JasperExportManager.exportReportToHtmlFile(jasperPrint,tmpFile.getPath());
> 
> or is better not use JRFileVirtualizer, and 
> 
> create the jasperPrint into a file and atfer export
> from the file to create the report?

I'm not sure whether creating a jasperPrint object into a file
will really keep the object from being created in memory before
it is sent to a file.  If the JasperPrint object is created in
memory first, then you would want to use the virtualizer to
create the JapserPrint object whether or not you write it to
a file.  (Sorry, I don't know the answer to this without looking
at the Jasper code.)


Cheers,
John
-- 
"I'm a tenth level Vice President!" - Al Gore (Futurama)


NOTICE: This message and any information, files or materials sent with may 
contain confidential and proprietary information or material of the sender, the 
recipient(s) or others, or information or material covered by the 
attorney-client privilege, attorney work product privilege, or other applicable 
privilege.  If you are not a named recipient or if you have received this 
message in error, please notify the sender immediately by return email, delete 
this email from your system, and do not disclose the contents of this 
transmission to any other person, use this transmission or any of its contents 
for any purpose, or further copy its contents.  Persons communicating with 
Works Operating Company, any of its affiliated companies, or any of their 
respective representatives by electronic means are advised and agree that such 
communications are reviewed for harmful or objectionable content or material.


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
jasperreports-questions mailing list
jasperreports-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jasperreports-questions

Reply via email to