Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leaks when using insert function, even with destroy. #762

Open
zsimple opened this issue Aug 2, 2017 · 1 comment
Open

Memory leaks when using insert function, even with destroy. #762

zsimple opened this issue Aug 2, 2017 · 1 comment

Comments

@zsimple
Copy link

zsimple commented Aug 2, 2017

I wrote a laravel command to operate many images, something like that:

while (true) { // use while-true to simulate lots of images
    foreach (Storage::files('tmp') as $file) {
        echo $file, "\n";
        $image = Image::make(storage_path('app/' . $file));
        // $img = Image::make(storage_path('app/' . $file));
        $img = clone($image);
        $img->crop(200, 100);
        // $this->some($img);
        $image->insert($img);
        $image->save(storage_path('tmp.png')); // without this save, grows much slower. It is another encode leaks issue I think.
        $img->destroy(); // without these two destroy, script booms very quickly.
        $image->destroy();
        usleep(25);
    }
}

The memory usage grows about 1M per second on my PC.

By the way, I am using GD2 driver on Windows. Maybe it's an issue of GD? I will try it on Linux later.

Anyidea?

@chescos
Copy link

chescos commented May 15, 2022

Same issue here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants