You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use nools to create a large number of flows dynamically from a set of flow definitions. Each flow definition is stored by a unique name which i use to create the flow object.
These flow objects are then managed by a LRU cache which disposes the flow object when required.
However in certain scenarios the LRU cache is destroyed and dispose is not called. In this case I have no more references available of all my previously created flows and when i try to recreate them I get an error saying they already exist.
I can bypass this by asking nools if the flow exists before recreating it.
However what do I do in the scenario when I never recreate a flow again. Wouldn't there be a memory leak caused due the reference maintained on the flows cache in index.js ?
An example to show more clearly what i mean
I create cache 1
I create Flow A and store in cache 1
I create Flow B and store in cache 1
I delete cache 1
I create cache 2
I create Flow A and find it already exists so i use it and store it in cache 2
I create Flow C and store it in cache 2
In this case if i never try to create Flow B again it will forever remain in the flows object and never be removed from memory.
I think there should be an option to disable storing a created flow in the flows cache in index.js or else this should be exported so that it can be cleared manually when needed.
The text was updated successfully, but these errors were encountered:
* Fixed issue noolsjs#68 where `matchUntilHalt` uses a lot of CPU
* Fixed issue noolsjs#45, now compiled rules support `or` constraint with more than 2 inner constraints.
* Added new feature to address noolsjs#76, now you can use `deleteFlows` to dispose all flows, or use `hasFlow` to check if a flow is already registred with `nools`.
I use nools to create a large number of flows dynamically from a set of flow definitions. Each flow definition is stored by a unique name which i use to create the flow object.
These flow objects are then managed by a LRU cache which disposes the flow object when required.
However in certain scenarios the LRU cache is destroyed and dispose is not called. In this case I have no more references available of all my previously created flows and when i try to recreate them I get an error saying they already exist.
I can bypass this by asking nools if the flow exists before recreating it.
However what do I do in the scenario when I never recreate a flow again. Wouldn't there be a memory leak caused due the reference maintained on the
flows
cache inindex.js
?An example to show more clearly what i mean
In this case if i never try to create Flow B again it will forever remain in the
flows
object and never be removed from memory.I think there should be an option to disable storing a created flow in the
flows
cache inindex.js
or else this should be exported so that it can be cleared manually when needed.The text was updated successfully, but these errors were encountered: