provide-free-support Ujjwal's Blog: jxl
Showing posts with label jxl. Show all posts
Showing posts with label jxl. Show all posts

Thursday, June 6, 2013

Fixing jExcel’s performance issue while running in a web application

Hopefully this post will help people who are experiencing performance problems with jExcel inside of a web application environment like Apache Tomcat, Websphere, and the like.  The short version of the post is this: if you’re experiencing a lot of slow-down while jExcel is being called set this switch in your web-application environment: jxl.nogc=true.  If you’re using Tomcat you’d modify the CATALINA_OPTS setting to be something like this:

CATALINA_OPTS=”…. -Djxl.nogc=true ….”

Now, the full explanation:
I use jExcel to create Excel documents on-the-fly.  It works really well, is simple to use, and is extremely fast; however, we were running into issues after creating the first Excel document.  The time spent creating the Excel spreadsheets to be written increased more than seven times after the first spreadsheet document was created.  Of course, this unacceptable, so I was tasked with finding the solution.


I loaded up the jExcel source code and began tracing through it figuring out how Excel documents are created within jExcel.  While I was searching, I was sent the following tidbit of information by one of my coworkers who was looking at the high level and stumbled upon it through this website (I would have eventually found this bit comment, but I’m glad he did since it saved me a lot of time).  The important bit of information is this in the WorkbookSettings class:
/**
* Flag to indicate whether the system hint garbage collection
* is enabled or not.
* As a rule of thumb, it is desirable to enable garbage collection
* when reading large spreadsheets from a batch process or from the
* command line, but better to deactivate the feature when reading
* large spreadsheets within a WAS, as the calls to System.gc() not
* only garbage collect the junk in JExcelApi, but also in the
* webservers JVM and can cause significant slowdown
* GC deactivated using -Djxl.nogc=true on the JVM command line
* Activated by default or by using -Djxl.nogc=false on the JVM command line
*/
The switch jxl.nogc was set to deactivate the manual call to Java’s garbage collection and the time spent setting up the Excel workbooks dropped by a factor of six from when we first tested the application.  Without the nogc activated jExcel performs a full garbage collection after certain operations are done within the jExcel code.  Which, as you can guess, full garbage collection while handling a request destroys any sort of quick response time that you might have been hoping for.
Cheers,
Ujjwal Soni

Thursday, May 3, 2012

Jxl Performace Tweak

I recently had to generate an excel report with large data set, but it kept failing as it goes out of memory, so i implemented below tweak in order to get output in a proper manner.

WorkbookSettings wbSetting = new WorkbookSettings();  
wbSetting.setArrayGrowSize(5*(int) Math . pow ( 1024 , 2 ));   
wbSetting.setUseTemporaryFileDuringWrite(true);  
WritableWorkbook workbook = Workbook.createWorkbook(response .getOutputStream(), wbSetting);

Keep visiting my blog,

Thanks,

Ujjwal Soni

Tuesday, January 27, 2009

Java Excel API - A Java API to read, write, and modify Excel spreadsheets

Hi Friends,

If you are developing an application in java for office automation, then, JXL jar api is best for you. Its simple & very easy to implement.

For more details, go to ->
http://jexcelapi.sourceforge.net/

Cheers!!!

Ujjwal B Soni
best-it-exam-    | for-our-work-    | hottst-on-sale-    | it-sale-    | tast-dumps-us-    | test-king-number-    | pass-do-it-    | just-do-it-    | pass-with-us-    | passresults-everything-    | passtutor-our-dumps-    | realtests-us-exam-    | latest-update-source-for-    | cbtnuggets-sale-exam    | experts-revised-exam    | certguide-sale-exam    | test4-sale-exam    | get-well-prepared-    | certkiller-sale-exam    | buy-discount-dumps    | how-to-get-prepared-for-the    | in-an-easy-way    | brain-dumps-sale    | with-pass-exam-guarantee    | accurate-study-material    | at-first-try    | 100%-successful-rate    | get-certification-easily    | material-provider-exam    | real-exam-practice    | with-pass-score-guarantee    | certification-material-provider    | for-certification-professionals    | get-your-certification-successfully    | 100%-Pass-Rate    | in-pdf-file    | practice-exam-for    | it-study-guides    | study-material-sku    | study-guide-pdf    | prep-guide-demo    | certification-material-id    | actual-tests-demo    | brain-demos-test    | best-pdf-download    | our-certification-material    | best-practice-test    | leading-provider-on    | this-course-is-about    | the-most-reliable    | high-pass-rate-of    | high-pass-rate-demo    | recenty-updated-key    | only-for-students-free-download    | courseware-plus-kit-for    | accurate-answers-of    | the-most-reliable-id    | provide-training-for    | welcome-to-buy    | material-for-success-pass    | provide-free-support    | best-book-for-pass    | accuracy-of-the-answers    | pass-guarantee-id    | pass-exam-key    | pass-sku-id    | study-for-exid    | pdf-sku-exid    | sku-pdf-id    | pdf-demo-key    | exam-demo-ske    | pass-it-dump    |
http://www.menuiserie-dauvergne.com/    | http://www.menuiserie-dauvergne.com/    |