• Resolved ziakhan707

    (@ziakhan707)


    I have PeepSo community plugin installed. I moved it’s files(pictures) location to uploads folder. In order to show PeepSo users image in the media gallery, I used media-sync plugin. When I try to sync the data, I get error “Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 299909120 bytes) in?/home/…/public_html/wp-content/plugins/media-sync/includes/MediaSync.class.php?on line?506” . I tried all possible solution on internet of increasing memory limits to almost 4096 MB through php.ini, wp-settings file etc. etc. but still the error message appears. I even applied init(memory_limit,-1) but still in vain. My server has 32 GB or RAM. The PeepSo plugin image directory has huge data of pictures, probably thousands of pictures.

    • This topic was modified 1 year, 11 months ago by ziakhan707.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author erolsk8

    (@erolsk8)

    Thank you for the detailed explanation but unfortunately, this is a known issue that is not yet solved. I’d try the same things you tried, so I don’t have other ideas :/

    I’m still not completely sure why it happens (I could never replicate it locally so trying to fix it was always a lot of guessing), but it might be:

    1. scanning for actual files – I already optimized this part as much as I knew how, or
    2. there is just too much UI to render – because this plugin lists all of the files at once (they are just hidden/collapsed, but it’s all there in DOM). That was actually the main reason to create this plugin. Because the only existing plugin I could find at the time (https://www.ads-software.com/plugins/add-from-server/) had pagination so I had to open each directory, select all, and then do import many times.

    So this approach worked fine for my needs at the time, but many people reported this memory issue already, and any solution I could think of (simpler list of files, no list, paginated list, etc.) would require rewriting almost the whole plugin. So I never found time to do it.

    Hi erolsk8,

    First of all, thank you for developing this plugin.

    But pls consider to add an option(a checkbox) for slower importing, the plugin saturates the server resources.

    it’s really aggressive, specially on slower servers, no need to rush ??

    Plugin Author erolsk8

    (@erolsk8)

    Hi @miladaliyari, known issue I explained above was before the actual import, so just while scanning the files.

    Importing should already be quite optimized since it imports files in batches of 10 which shouldn’t require much resources (it just adds a few database records per file, but no file is moved, copied, etc.). Maybe some other plugins listen to some of these updates and run their own actions.

    I just tried to import 3259 images in WordPress 6.2 (PHP 7.2.34) on an actual (cheap/basic) server, so not locally – and it worked fine. The only issue I found was that it stopped when my computer went to sleep (because it was taking so long). But then I just ran import again and it continued where it left off. I imagine that similar thing could happen if your WP login session expires. And slowing it down even more would just make this more likely to happen.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Fatal Error’ is closed to new replies.