It is the part of a stand alone process for the time being for testing,
after the testing I have write a code for the web-application. 


// Get current size of heap in bytes
    long heapSize = Runtime.getRuntime().totalMemory();
    System.out.println("Initial heap size  ="+heapSize );
    // Get maximum size of heap in bytes. The heap cannot grow beyond this
size.
    // Any attempt will result in an OutOfMemoryException.
    long heapMaxSize = Runtime.getRuntime().maxMemory();
    System.out.println("Maximum heap size  ="+heapMaxSize );
    // Get amount of free memory within the heap in bytes. This size will
increase
    // after garbage collection and decrease as new objects are created.
    long heapFreeSize = Runtime.getRuntime().freeMemory();
    System.out.println("Maximum heap size  ="+heapFreeSize );




Output:

Initial heap size  =2031616
Maximum heap size  =66650112
Maximum heap size  =1677312








Regards
Awais Bajwa










-----Original Message-----
From: Mahesh Ganapathy [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 02, 2008 2:01 PM
To: Awais Bajwa
Subject: Re: Out of Memoary Error while reading an EXCEL file

Do you have poi parser as a part of standalone application or as a part of
another webapplication. If it is running as a part of web application can
you see what the maximum memory as consumed by that application before
invoking poi calls?
------Original Message------
From: Awais Bajwa
To: 'POI Users List'
To: [EMAIL PROTECTED]
Subject: RE: Out of Memoary Error while reading an EXCEL file
Sent: Oct 2, 2008 12:58 PM

Hi Mahesh,

Following are the initial heap and maximum heap sizes I am currently using:

  long heapSize = Runtime.getRuntime().totalMemory();
    System.out.println("Initial heap size  ="+heapSize );  ==> 2031616




long heapMaxSize = Runtime.getRuntime().maxMemory();
    System.out.println("Maximum heap size  ="+heapMaxSize );  ===>  66650112






-----Original Message-----
From: Mahesh Ganapathy [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 02, 2008 1:17 PM
To: POI Users List
Subject: Re: Out of Memoary Error while reading an EXCEL file

What is the max jvm heap size? Are you running this on an app server? 
Sent via BlackBerry by AT&T

-----Original Message-----
From: "Dobson, Paul L CTR USAF AFMC 416 SCMS/OBN" <[EMAIL PROTECTED]>

Date: Thu, 2 Oct 2008 10:34:37 
To: POI Users List<[email protected]>
Subject: RE: Out of Memoary Error while reading an EXCEL file


I was having the same problem.  I ended up using the event driven model
to parse the file.  Then there is no limit on file size.

-----Original Message-----
From: Awais Bajwa [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 02, 2008 10:34 AM
To: 'POI Users List'
Subject: Out of Memoary Error while reading an EXCEL file

Hi Folks,

I have an excel file that has many sheets and many rows, my requirement
is
to pick a specific cell from one row. But when I load the file that is
54MB
of excel file. I get an Out of memoary Error at:

    fileSystem = new POIFSFileSystem (inputStream);



Any thoughts??? Any limitation of POI?

Regards


Awais




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





Sent via BlackBerry by AT&T



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to