Comments (6)
But, when deploying it to my production server, I am getting memory leaks that generate files which names contains some parts of the content of my .xlsx, not in the directory it was called, by in the root directory of my application.
The libxlsxwriter lib creates some temporary files that are zipped/assembled into a xlsx file. It is possible that if the application fails that these temp files are left behind. Typically they are xml files.
This shouldn't be causing a memory leak though.
Yesterday, I also got the problem:
[ERROR][packager.c:62]: Error opening zip file for xlsx [ERROR][workbook.c:1108]: Memory allocation failed.
This is a misleading error. It is caused by not having sufficient write permission to create the output file. See the explanation in Issue #12.
Do I have to grant writing permission recursively to the directories preceding the directory where the file is being generated?
Possibly. You, or your app, should be able to do something like this without getting an error:
touch /path/to/output/dir/some_new_file.xlsx
I there a way you would recommend me to simulate my production environment in order to effectively test the embedded lib?
I don't have any sure fire suggestions. Debugging write permission in a web app can be tricky.
By the way, there is a Ruby port of the original Perl module that libxlsxwriter is ported from: https://github.com/cxn03651/write_xlsx
from libxlsxwriter.
Thank you for answering.
I already use write_xlsx gem. The problem with it is that it consumes too much memory when exporting a large number of rows (~ 1MM), which makes my app to stop the process in order not to fall.
When I used your solution embedded with my Rails app in constant memory mode, it only consume 2% of my machine RAM and took only 30 seconds to generate my .xlsx file. I'm going to try once again and I'll report you any other issues!
Thank you again!
from libxlsxwriter.
I already use write_xlsx gem. The problem with it is that it consumes too much memory when exporting a large number of rows (~ 1MM), which makes my app to stop the process in order not to fall.
I didn't realise that the Ruby port hadn't ported the constant_memory/optimization mode. It was in the original Perl module and is in my Python and Lua versions as well.
from libxlsxwriter.
I used strace command to attach it to the process. The error I get is the following:
open("/var/www/app/public/exports/ff/c3/8e/ffc38ef077171f690eb01cfe8792845b/test.xlsx", O_WRONLY|O_CREAT|O_TRUNC, 0666) = -1 EACCES (Permission denied)
write(2, "[ERROR][packager.c:62]: Error op"..., 56) = 56
write(2, "[ERROR][workbook.c:1108]: Memory"..., 52) = 52
write(1, "=> 1\n", 5)
I just did not realise yet what is causing this.
from libxlsxwriter.
Closing this issue because it looks more like a permissions issue than a libxlsxwriter issue.
Note, the current HEAD version gives a clearer error message in this condition:
$ make examples
$ ./examples/hello
$ chmod -w hello_world.xlsx
$ ./examples/hello
[ERROR] Error creating 'hello_world.xlsx': Permission denied
from libxlsxwriter.
@eroncastro do you have your wrapper open sourced?
@jmcnamara sorry if this bothers you
from libxlsxwriter.
Related Issues (20)
- Using this lib in for another computer language HOT 2
- Implement the $book->set_custom_color() function from the Perl library in the C library HOT 2
- Linker error when trying to use latest version with macOS project HOT 1
- File creation performance HOT 2
- Linux(CentOS6) Build Error.
- LXW_ERROR_CREATING_XLSX_FILE: error creating output xlsx file. Usually a permissions error. HOT 1
- cannot run on x64 Release in Visual Studio 2022 HOT 5
- Issue: Corrupt file compiled using VS2008 on Windows HOT 9
- Issue when using constant memory with merge range HOT 2
- password HOT 1
- Still Tagging Releases? HOT 2
- 1.1.6 release did not get marked as latest release HOT 4
- How to insert image data of type CV:: Mat HOT 2
- test/functional/test_image.py::TestCompareXLSXFiles::test_image58 failure on 32bit architectures HOT 8
- Bug: workbook_validate_sheet_name buffer-overflow HOT 4
- Bug: workbook_add_worksheet does not return a reasonable worksheet HOT 1
- workbook_define_name stack-buffer-underflow HOT 2
- workbook_close stack-buffer-overflow HOT 4
- _store_array_formula heap-buffer-overflow HOT 5
- worksheet_set_selection stack-buffer-overflow HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libxlsxwriter.