0

We have a set of utility programs which reads an .xlsx file for some input data and generate reports, Apache POI is used for this purpose. Excel file got 8 sheets with an average of 50 rows and 20 columns of data. Everything was working fine in normal Windows 7 box (Read developers machine). The file reading will get finished in few seconds.

Recently we moved these jobs to a Windows Server 2012 R2 box and we have noticed that the last sheet in the excel file takes lots of time to finish reading. I have duplicated the last sheet to confirm that this is not the data issue and executed the job, the second last sheet( was the last one in the previous execution) got finished reading in milli seconds and the last one (duplicated sheet) got again stuck for 15 minutes. My best guess here is that this may be because the time taken to close the file is getting too high but that is just a guess and no concrete evidence to prove that, also if that is the case I am not sure why so. Only difference between working Windows boxes and non-working boxes are the OS, rest all configurations are similar. I have analyzed the heap and thread dump and no issues found.

Is there any known compatibility issues with POI and Windows server boxes? Or is it something related to code? We are using POI-XSSF implementation.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Rajeev
  • 339
  • 2
  • 12
  • 1
    `Apache POI` is `Java` software. So it does not run within a "Windows Box" directly but within a Java Virtual Machine in a Java Runtime Environment. So I would compare the Java JRE versions between the Windows systems and have a look at the fulfilling the [system requirements for Java](https://www.java.com/en/download/help/sysreq.xml). – Axel Richter Feb 17 '17 at 16:53
  • I have done the comparison and the VMs are same, both run on Java 1.8. There is no problem in running a Java VM, as I mentioned in my problem the excel file reading is stuck at the last sheet always – Rajeev Feb 18 '17 at 08:44
  • 1
    Then the next I would do is creating the smallest possible example which only reads an `*.xlsx` containing multiple sheets the same way you are doing this in your current program. Only without the whole stuff around this simple task. Then I would testing this in both systems. If it's performance differs even in it's smallest shaping, then you can post the code here and ask why it differs. Otherwise append further stuff you are doing in your current program and test again. Do this until the performance difference occurs. Most times you know then what the reason is. If not, you can post the code – Axel Richter Feb 18 '17 at 09:02

1 Answers1

0

Ok, finally we got the problem; the issue identified is with the the VM itself, the Disk I/O operation is always 100% and file read/write was taking a lot of time to complete, this caused the program to stuck there. However we couldnt identify why the disk I/O is high, tried some blogs but didnt work hence we downgraded the OS to Windows 2008 server and it worked well.

Note that there is nothing to do with POI or anything, it was certainly a VM/OS issue.

Rajeev
  • 339
  • 2
  • 12