Complex xlsx template resulting in heap out of memory error



  • Hello, I've been having some issues since upgrading jsreport (using jsreport-core) from v2 with some of the more complex reports that our applications generate. There are multiple sheets generated within these templates, but the only sheets that we are interacting with are blank tables being filled with data. The portion that makes the reports more complex are the other sheets within the template with a handful of macros and a large amount of rows, etc. I have dumbed down the template as much as I can while still maintaining the functionality required, but am still having problems with the heap running out of memory.

    I can include more information if it's necessary, but I have tried a multitude of approaches to this issue with no luck on my end so figured I would ask in case anyone else has seen something like this. I tried removing all custom functions referenced within the handlebars file, only calling the xlsxPrint function, but it still fails. These same reports would take a decent amount of time to generate in v2, but it would go through just fine.

    And I have already tried increasing max-old-space-size, as well as the timeout, to no avail. Increasing the size just causes it to timeout, and increasing both the timeout and size just makes it run for ridiculously long times, like 10+ minutes.



  • I understand you have a complex app, but isolating the issue is anyway the key. Would you be able to share a repo with minimal lines that still cause the timeout/OOM?



  • Of course! I'll start setting that up now and respond when I have it all running as expected, just wanted to check and make sure there wasn't some standard fix for issues like this that I had missed in my research before doing all the work of setting all that up.



  • Apologies for the late response, had other issues that needed tending to. I've created a repo on my personal github with the minimal necessary code to replicate this issue, but would prefer to keep it private if at all possible. I found what I believe to be your github account, but figured it would be rude to just invite you as a collaborator without first asking about it here.



  • Yes go ahead. This is my gh profile page https://github.com/pofider



  • Alright, you've been added as a collaborator. I've got the instructions to replicate the issue in the readme.



  • As a followup for anyone finding this via google, etc., this was mainly an issue with my template being entirely too complex. In order to remedy the situation, I created an excel macro to re-create the more complex portions of the template after the data has been generated and added via jsreports. However, I have run into another issue, of which I'm not sure if it would be more appropriate for me to create a new forum topic or append to this one, but since it's from the root of the same issue I opted for the latter.

    I created a button on the template in order to run the macro, but it seems like that button specifically is causing issues. After generating the file and attempting to open it, I get a message saying there is a problem with some content and asking "Do you want us to try to recover as much as we can? If you trust the source of this workbook, click Yes."

    After clicking Yes, the entire sheet with the button on it is blanked out. I was unable to find any forum posts or information regarding an issue like this and figured I would see if it was a known issue or if there was some method I was missing to resolve this. Thanks so much.



  • Could you please share the template or a playground demo?


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.