macroquad icon indicating copy to clipboard operation
macroquad copied to clipboard

`get_screen_data` leaks memory and is not deallocated when the program exits

Open martin-t opened this issue 2 years ago • 2 comments

Using macroquad 0.4.4:

use macroquad::prelude::*;

#[macroquad::main("BasicShapes")]
async fn main() {
    loop {
        get_screen_data();

        next_frame().await
    }
}

This will make memory usage grow very fast until it crashes the system.

Memory usage does not decrease by quitting the program, i had to use sudo zsh -c 'echo 3 >| /proc/sys/vm/drop_caches'. Using Kubuntu 22.04.

martin-t avatar Oct 03 '23 19:10 martin-t

Same issue on Mac when using the get_screen_data() function in the loop. Memory does decrease on crash/quitting though.

Afrovis avatar Nov 05 '23 01:11 Afrovis

This issue should have been closed by #666, no?

ElnuDev avatar Apr 10 '24 23:04 ElnuDev