I tried this and checked the results using gcviewer and the startup options:

-verbose:gc -Xloggc:D:/AribaDev/xmlFrameworkTests/gctest/test.gc
-XX:+PrintGCDetails -XX:+PrintGCTimeStamps

It showed that the memory usage went up to 190,000k usage and then after
first GC it droped to 100,000k then the memory used by the Java app sat at
130,000K and the memory actually used was 100,000k.

I think this looks about right for how it should be used. I did check that
file handles were closed.

Hope this helps
Regards
Richard

On 10 April 2010 16:57, Robert Lowe <[email protected]> wrote:

> Alberto, I think you might be misunderstanding what garbage collection
> actually does. My understanding is that garbage collection will never
> reduce
> the amount of memory allocated to the JVM, it simply attempts to free space
> on the heap within the JVM for use by other Java objects. - Rob
>
>
> On Wed, Apr 7, 2010 at 10:36 PM, Alberto Pedrera <[email protected]
> >wrote:
>
> >
> > Hi all.
> >
> > I have this code.
> >
> > public static void main(String[] args) throws Exception{
> >        try{
> >                File input = new File("D:/test.xlsx");
> >                System.out.println("Open the file");
> >                Workbook wb = new XSSFWorkbook(new
> FileInputStream(input));
> >                System.out.println("Open correctly");
> >                while(true){
> >                        System.out.println("Clean the memory");
> >                        System.gc();
> >                }
> >        }catch(Exception e){
> >                log.error("Error Main", e);
> >        }
> > }
> >
> > My java process needs great deal of memory but when it executes "clean
> the
> > memory" this memory is never liberate. Test.xlsx has 25000 lines and 50
> > columns and memory consume is 1300MB.
> > Someone can help me?
> >
> > Best regards.
> > Alberto.
> > --
> > View this message in context:
> > http://old.nabble.com/Process-java-memory-tp28165914p28165914.html
> > Sent from the POI - User mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [email protected]
> > For additional commands, e-mail: [email protected]
> >
> >
>

Reply via email to