mweastwood / CasaCore.jl

A Julia wrapper of CasaCore.

Home Page:http://mweastwood.info/CasaCore.jl/stable/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

memory leak in CasaCore.Measures

mweastwood opened this issue · comments

Do the following a 100,000 times and I'm seeing ~1GB memory usage. Oops.

frame = ReferenceFrame()
set!(frame, Epoch(epoch"UTC", 1.0seconds))
set!(frame, Position(pos"ITRF", 0.0, 0.0, 1.0))

This seems to be at least partly due to the fact that the Julia GC doesn't truly understand how large some of these objects are. All it sees is a pointer so there isn't ever any memory pressure to call the finalizer. I possibly need to rethink how I am doing things here...

It would be great actually if I never had any types with Ptr{Void} fields that are deleted only when the finalizer gets called.

Fixed by #65

There is still a Ptr{Void} field in Table, so I think there will also be memory problems if you're opening thousands of tables, but I think that's a fix for another time.