Hello,
For the discount on variation, you can set it up like this:
with attribute_pa_official-attribute the slug on the variation attribute.
About the memory leak, that's strange because that's not supposed to work like that. Can you open a ticket and provide your credentials so we can run a full debug?