Skip to content

Repeated calls to LSL.StreamInlet .info().channel_count() leaks memory #9

@boulder-on

Description

@boulder-on

The following code will leak memory

while (true) {
   float[] sample = new float[inlet.info().channel_count()];
   inlet.pull_sample(sample);
}

Whereas this works properly

float[] sample = new float[inlet.info().channel_count()];
while (true) {
   inlet.pull_sample(sample);
}

I my experiment, I was collecting data at about 1 kHz. After an hour using the first snippet, my Java process was using about 20 GB. This obviously has an easy work around, but it does indicate that there is memory leaking somewhere (inside the native code?).

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