7

In our application, we allow users to upload/download data through an excel sheet and we use Apache POI to read and write these excel sheets.
We were planning to migrate all our xls sheets to xlsx, but came to know during the process that the memory footprint of XSSF(for xlsx) through Apache POI is significantly high.

As a result, we wanted to stress test this, and verify that moving to xlsx won’t give us frequent OutOfMemory exceptions. Any pointers, on how we can effectively record the memory footprints, while we stress test this functionality with larger excel(xlsx) files.

Thanks!

1
  • Possible duplicate of this thread. Lot of recommended profilers are mentioned in that thread. Commented Jun 7, 2011 at 15:30

2 Answers 2

5

A simple approach is to use a tool such as jconsole or jvisualvm (which is shipped with the JVM) to manually monitor the memory consumption.

You could also periodically use the runtime API to measure memory consumption.

Sign up to request clarification or add additional context in comments.

Comments

4

As @Johan mentioned, you can use a profiler or leverage some combination of the methods maxMemory, totalMemory, and freeMemory from the Runtime. If those results indicate that memory footprint is indeed a problem, Apache POI does offer another option with lighter footprint for XSSF. It's harder to use, so I wouldn't recommend using it unless your profiling results indicate that you have to, but it could help.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.