JuliaIO / MAT.jl

Julia module for reading MATLAB files
MIT License
278 stars 71 forks source link

Memory leak issue #62

Closed DatName closed 4 years ago

DatName commented 7 years ago

I seem to have a memory leak. The following steps should reproduce the problem.

Create a data structure in matlab via testData = struct('asString', 'aaaa', 'asFloat64', 122, 'asAnotherFloat64', 22) then save it: save('D:\\testdata.mat', '-struct', 'testData') then run the following code in julia:

using MAT

function thyTest()::Void

    for j::Int64 = 1 : 100000
        matfile = matopen("D:\\testdata.mat")

        m_open::String  = read(matfile, "asString")
        m_high::Float64 = read(matfile, "asFloat64")
        m_low::Float64  = read(matfile, "asAnotherFloat64")

        close(matfile)
    end

    return nothing
end

then runthyTest() and gc(). This leaves me with 3 Gb RAM usage by julia which can never be freed during its lifetime.

I'm running this under windows julia version is 0.5 MAT version is 0.3.1

simonster commented 7 years ago

Probably the same issue as https://github.com/JuliaIO/HDF5.jl/issues/349

musm commented 4 years ago

fixed