-
-
Notifications
You must be signed in to change notification settings - Fork 344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It seems there is a memory leak in constant memory enabled when trying to insert date #453
Comments
If it is the last one and your /tmp is mapped to memory then the application is consuming disk space but that disk space has been mapped to memory. If this is the case then libxlsxwriter has an option to change the location of the temp files it used: http://libxlsxwriter.github.io/workbook_8h.html#a7329be90faba9e9ee65f58cb221aa4f1 Check if php-ext-xlsxwriter has the same opinion. Note, libxlsxwriter has hundreds of tests for memory leaks that run in the CI so it is unlikely that it is an actual leak. |
@jmcnamara, thansk for the tips, there is no option to change the location of the temp files in the php-ext-xlsxwriter , and the problem it not the tmp files, I run the code on MacOS, Ubuntu , Alpine linux, all have the issue. I think it can reproduced by this link, you can observe continious growth of memory when constant memory enabled and insert 1 million rows with a datetime. sorry it is PHP code. |
Ok. Sorry I can't help you other than the advice above. |
@jmcnamara after some experiments, I found this line caused the memory leak. does the code below remind you something please? the below are from the
|
That definitely looks like an issue. It seems to be creating a new format object for each call to You should contact the author and let them know. You may be able to work around it by writing a number instead of a date. In Excel a date is a number with a format. You will need to covert the dates yourself but it will avoid this issue (unless the number writer is doing the same thing). See: https://libxlsxwriter.github.io/working_with_dates.html |
@jmcnamara I see, thanks a lot. Finally, I understand what the real problem is. The
except strings, the |
Closed as solved by php-ext-xlswriter, @jmcnamara thanks for help, |
Sorry, I don't know much about C. I can't reproduce it with C. I only found the problem in here. I copy the critical code here if you can spot it quickly. The code enabled const memory is not copied here, but it is enabled in my local. The code looks very normal.
The text was updated successfully, but these errors were encountered: