I know that it is possible to restrict (or extend) the memory usage of the entire WP site using:
Is it possible to do the same for only one plugin that the website uses ?
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.Sign up to join this community
Generally spoken, no, it is not possible for a particular plugin only. The plugin runs in the whole wordpress PHP process (normally) and therefore it shares the memory limit setting with the rest.
You can however try to limit the memory before each time the plugin is called. That would be prior any hook of it (that's possible) and then in the beginning prior the inclusion (that's much harder to achieve).
The define of
WP_MEMORY_LIMIT gets overwritten by the way, so setting that constant to something is not useful if you actually want to limit memory.
If you do not fear to deal with system internals, you can however limit the memory for the whole process properly as well as if you like it experimental, you can give runkit a try and execute the plugins code therein - somehow.