GiovineItalia / Gadfly.jl

Crafty statistical graphics for Julia.
http://gadflyjl.org/stable/
Other
1.9k stars 250 forks source link

Memory leak when writing PDF File #1415

Open Greg-R opened 4 years ago

Greg-R commented 4 years ago

Hello, I am observing an apparent "memory leak" when using Gadfly to create a PDF file from a plot. I am using Linux Ubuntu 18.04 on Intel 64 bit and Unbuntu 19.04 on Arm 64 bit platforms. I am using the Julia 1.4 binary downloaded from the web site.

I found this problem on the Arm64 platform which is a Raspberry Pi 4, which is crashing due to running out of memory. My application is creating a lot of PDF files, and the crash only happens after running the application many times. gadfly_mem.jl.zip

I have attached a simple demo of the problem. From the Julia REPL:

include("gadfly_mem.jl") using .gadfly_mem test_plotting()

Using the bash "free -m" command, you can see the available memory in megabytes. The above command test_plotting() will drop the available memory by about 200 megabytes. The Julia garbage collector does not appear to recover the memory. If Julia is exited, however, the Linux kernel recovers the memory.

This is the only problem I have observed with Gadfly. My results so far have been excellent!

Regards, Greg-R

Mattriks commented 4 years ago

Please put your code in a github gist and provide a link to the gist.

Greg-R commented 4 years ago

https://gist.github.com/Greg-R/f652e8cf2dcb18d2046b8c451a424d64

Linked above, first time to create a "gist". Greg-R

bjarthur commented 4 years ago

could be related to this comment