Sorry, I am a bit new to code development, and this may be a really nonsensical question, but I was just curious to know how much JVM memory is allocated to an object of XSSFWorkbook
.
I am developing a JSP-Servlet based application for which I am using excel sheets for input.
For a single user, the application works fine, but for multiple users, getting
java.lang.OutOfMemoryError: Java heap space.
The Java heap space was resolved by setting the Xmx parameter minimum to -Xmx512m
though, but I wanted to optimize my code so that the application can be run using even lesser JVM memory space.
I read that for optimal code Apache POI Streaming, SAX- SXSSFWorkbook
should be used, but I am not in the position to change the excel code.
Does Garbage Collection work if the object of XSSFWorkbook
is closed?