MemoryError encountered when loading large gcode file
Hi Seguin,
First of all I would like to salute you and Kliment for doing a great job in Printrun/Pronterface. You provided people all over the globe a fantastic software for 3D Printing use especially it's free.
To briefly introduce myself, I'm Billy John Moreno from the Philippines. I currently handles a 3D Printing software project which is based on Printrun/Pronterface and also written in Python. The gui is much different from pronterface but the functionalities generally came from it. The company where I'm working now is going to sell the software together with the 3D printer.
The software is generally working fine except that I'm encountering a memory error when I tried loading a large gcode file. From my series of tests, i found out that a gcode file with a size starting from 30MB would already encounter a memory error.
And also I've found out that even though I'm using the most updated version of Pronterface, running from source, I would also encounter the same error. I have the source codes of Printrun 2015.03.10 which I believe is the latest version. This version can still load a 30MB file without error, but already fails to load 32MB at some point. Though in our revised version already fails in 30MB.
Since the company is selling the software, it will be bad reputation for the company if the user loads a large file and would encounter the said error. So I need to find out how to fix this memory issue. I've searched though the web regarding this issue but it's hard for me to decide which one is the right thing to do because of the reason that I'm new to python programming and to 3D printing world. I'm not new to programming, but this is my first time to develop a software for commercial use. That's why I'm quite pressured to find out for solutions.
I came across to a post in this link, https://github.com/kliment/Printrun/issues/380
which is related to loading of a large gcode file but I think the solution you provided there is not working in my case, so I decided to send an email to you.
Here's the details of my tests: By the way I'm supposed to attached the files which I've tried loading, screen captures of the tests and the logs of the errors for each file loaded, but the files are big enough to be uploaded here Please see your e-mail, I have also sent the same message which I have written here together with the files.
Initially, upon opening the software, my task manager reports that pronterface uses around 54MB of system's memory.
- 30MBFile.png is the screen capture when I loaded the 30MB file. In this case my task manager reports that I'm using around 320MB of system's memory. Please see 30MBFileLog.txt for the error log.
- 32MB_1.png is the screen capture when I loaded the 32MB file for the first time.
In this case my task manager reports that I'm using around 334MB of system's memory. - 32MB_2.png is the screen capture when I loaded again the 32MB file for the 2nd time at the same instance of pronterface.
In this case my task manager reports that I'm using around 400MB of system's memory. Please see 32MBLog.txt for the error log. - 52MB_1.png is the screen capture when I loaded again the 52MB file for the 1st time.
In this case my task manager reports that I'm using around 727MB of system's memory. Please see 52MBFileLog_1.txt for the error log. - 52MB_2.png is the screen capture when I loaded the 52MB file for the 2nd time but another instance of pronterface. In this case my task manager reports that I'm using around 760MB of system's memory. Please see 52MBFileLog_2.txt for the error log. You can see here that there is also GLException error included. This results when I tried to rotate the gcode view.
In addition to the above, there is also an instance that the gcode file is loaded properly on the view but after printing a couple of hours, the view is gone and there comes the memory error. Though even though I cannot properly load the file in the gcode view. I can still print it.
I understand that this gcode view contributes a large part on the memory consumption, and even accumulates more during printing process which I think is because of the highlighting of the currently printed position. My question is there a way to reduce this memory consumption?
And im guessing that the system automatically allocates a certain amount of memory for the software and when the software reaches that amount, there comes the memory error. If this is so can we adjust this amount to a certain amount so that users who wish to load a very large file won't encounter this memory error?
I have a suspicion that the memory error can be encountered depending on the number sample points or gcode coordinates which the slicer generates when the stl file is sliced.
Im running the software on a Lenovo laptop with 16GB RAM, Intel Corei7 @ 2.4GHz CPU, Windows 8.1 64bit, 4GB NVIDIA GEFORCE videocard installed. These I think is good enough to conquer a memory hungry software.
I'm sorry if in case I'm asking to much or too bold enough to ask you of these things. Also I apologize if I explained things here so badly. I'm sorry it took hours for me to prepare this since I'm not that good in English.
Thanks in advance.
Regards, Billy
Already fixed. You must put: (i tried on windows, and get working)
git clone https://github.com/kliment/Printrun py -m venv venv venv\Scripts\activate python -m pip install -r requirements.txt python pronterface.py