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 Leak on publish #11245

Open
waldemar-p opened this issue Dec 11, 2024 · 6 comments
Open

Memory Leak on publish #11245

waldemar-p opened this issue Dec 11, 2024 · 6 comments

Comments

@waldemar-p
Copy link

waldemar-p commented Dec 11, 2024

Bug description

I Upgraded from statamic 4 to 5 and after that I couldnt publish on production anymore. Weirdly it works on my local machine.

I am unsure how much influence it has, but I also have the revisions enabled.

How to reproduce

Sadly I don't know that. I am sorry, but maybe you can help me anyway.

Logs

No response

Environment

Environment
Application Name: Actiware
Laravel Version: 10.48.25
PHP Version: 8.2.26
Composer Version: 2.2.6
Environment: local
Debug Mode: ENABLED
URL: 127.0.0.1:8000
Maintenance Mode: OFF

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: file
Database: mysql
Logs: stack / single
Mail: smtp
Queue: sync
Session: file

Statamic
Addons: 1
Sites: 3 (Deutsch, Schweizer Hochdeutsch, English)
Stache Watcher: Disabled
Static Caching: Disabled
Version: 5.42.0 PRO

Statamic Addons
aerni/font-awesome: 3.0.2

Installation

Fresh statamic/statamic site via CLI

Additional details

I use statamic headless, but I think that's of no importance.

@duncanmcclean
Copy link
Member

I Upgraded from statamic 4 to 5 and after that I couldnt publish on production anymore. Weirdly it works on my local machine.

When you say you can't publish on production anymore, what do you mean? The browser tab crashes, you get an error?

Are you able to provide a video recording of what you're seeing?

@waldemar-p
Copy link
Author

I Upgraded from statamic 4 to 5 and after that I couldnt publish on production anymore. Weirdly it works on my local machine.

When you say you can't publish on production anymore, what do you mean? The browser tab crashes, you get an error?

Are you able to provide a video recording of what you're seeing?

I'm sorry I was too vague.

On publishing the php-fpm command starts using a lot of memory and after a few seconds all memory on my sever is used, php kills itself and the cms is down until I restart php.

@waldemar-p
Copy link
Author

Here is an image of a part of htop
image

The memory usage keeps rising, but it's hard to screenshot. This happens immediately on the publish-request
image

@duncanmcclean
Copy link
Member

Do you have any event listeners?

@waldemar-p
Copy link
Author

<?php
// app/Providers/EventServiceProvider.php

namespace App\Providers;

use Illuminate\Auth\Events\Registered;
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Event;

class EventServiceProvider extends ServiceProvider
{
    /**
     * The event listener mappings for the application.
     *
     * @var array<class-string, array<int, class-string>>
     */
    protected $listen = [
        Registered::class => [
            SendEmailVerificationNotification::class,
        ],
    ];

    /**
     * Register any events for your application.
     *
     * @return void
     */
    public function boot()
    {
        //
    }
}

And other Eventlisteners were not created.

@waldemar-p
Copy link
Author

I've just tried disabling the revision system, then it happens on patch.
image

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

2 participants