• Resolved rkbhochalya

    (@rkbhochalya)


    Hi @rockfire, thanks for adding support for JSON-LD data. This change is very useful but it has a memory leak. It looks like you are setting transients without an expiry date. Please note that transients without an expiration time are autoloaded. With JSON-LD data support the size of each transient become 2-3 MB increasing autoloaded options size to 200-300 MB for a 100 post website.

    This needs to be fixed immediately. I’m happy to submit a PR but I could not find the plugin’s repository on github and I’m not familiar with SVN.

    NB: transients that never expire are autoloaded, whereas transients with an expiration time are not autoloaded. Consider this when adding transients that may not be needed on every page, and thus do not need to be autoloaded, impacting page performance.

    https://codex.www.ads-software.com/Function_Reference/set_transient#Notes

    • This topic was modified 5 years, 1 month ago by rkbhochalya.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Richard Korthuis

    (@rockfire)

    Hi @rkbhochalya

    Thank you for using our plugin and thank you for finding this memory leak. You are absolutely right that transients shouldn’t be set without an expiration, the fact we didn’t notice this memory leak is probably due to the fact that we always use it together with our WP REST Cache plugin, which causes the transients from this plugin not to be set.

    We just released a new version of our plugin which fixes this memory leak. It adds an expiration to new transients and deletes the old transients (deletion only as long as you are not using external object caching).

    Thread Starter rkbhochalya

    (@rkbhochalya)

    ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Memory leak in transients’ is closed to new replies.