Skip to content

ZIPMAT BUG: "zmat" used up all system memory #11

Closed
@xingchenli1996

Description

@xingchenli1996

% test code:

C = zeros(100000,1);

for i = 1:100000

    if isPrimeNumber(i) ~= 1

        tmp = randi(256, 1, 16384); tmp = tmp - 1; tmp = uint8(tmp);

    elseif isPrimeNumber(i) == 1

        tmp = repmat(128, 1, 16384); tmp = tmp - 1; tmp = uint8(tmp);

    end
    
    C(i) = size(zipmat((uint8(tmp)), -9, 'lzma', 'nthread', 1), 2);

    disp([num2str(C(i)), ';         ', num2str(i), ' / ', num2str(100000)])

end

The usage is to test whether a big and complex data contained some lines that can be compressed to a smaller size than its original size.

And, after the subfunction run succesfully, the temporary variable cleared, but the system memory occupied by ZMAT mex does not free automatically, and to my surprise, continue growing. except a quit and restart of MATLAB Application (which is absolutely impossible during script running)

When this code is running, system will use up at once.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions