owl icon indicating copy to clipboard operation
owl copied to clipboard

Possible Memory leak

Open Gorash opened this issue 4 years ago • 2 comments

There is no easy way to clear the memory. (no destroy method for eg).

atNodeEncounter in QWeb.addDirective add some content on QWeb.slots. If we use in custom project owl, how to avoid a memory leak?

Thanks

Gorash avatar May 19 '20 13:05 Gorash

Hey Christophe,

not sure about your specific usecase. The slots object contains sub template compiled functions, so yes, if you add a template, then it will take up some memory. Owl assumes that you will not have a ever growing list of templates.

This may be an issue if you dynamically generate templates all the time, but I would say that it is not a common usecase. Do you need a way to remove a template, and all its subtemplates from owl?

ged-odoo avatar May 19 '20 17:05 ged-odoo

Hi Géry,

We don't have the possibility to do that, the templates can be added dynamically and are loaded when launching the library (our editor). Several editors can coexist with different configurations and different templates. They are opened then stopped. So when we start, we create a new Qweb() and load the templates. When we stop we would like to have everything removed/destroyed.

Gorash avatar May 20 '20 08:05 Gorash