Skip to content
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

Memory leak #21

Closed
vchuravy opened this issue Mar 14, 2014 · 0 comments
Closed

Memory leak #21

vchuravy opened this issue Mar 14, 2014 · 0 comments

Comments

@vchuravy
Copy link
Member

Hey,

I am encountering a memory leak using OpenCL.jl

Execute the following in the REPL

import OpenCL; const cl = OpenCL
function leaky()
          device, ctx, queue = cl.create_compute_context()
          # Allocate buffer
          a = cl.Buffer(Float64, ctx, :rw, 1024*1024)
          cl.flush(queue)
          cl.release!(queue)
          cl.release!(ctx)
end

for i in 1:100000
   leaky()
end

gc()

Monitoring my process with htop I can see that Julia is now using ~400mb permanently, running the loop a second time results in an increase in memory of ~300mb.
This 300mb step is consistent over consecutive repetitions.

This happens to me both with the OpenCL implementation by Intel (CPU) and by Nvidia (although here I don't have any number available).

I am running Julia version 0.3.0-prerelease+2000 Commit 48ac426* (1 day old master) and OpenCL.jl current master.

If I try to manually release the Buffer with cl.release! I get an error about double freeing the Buffer.

Discussion on the mailing list: https://groups.google.com/forum/?fromgroups=#!topic/julia-dev/SRz6OkQ5hMw

Best,
Valentin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants