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
Description
This is more of a ux/optimazation issue.
Right now Disposable (Array Pool List) entities in the code base are disposed/handled based on the discretion of the dev.
It is very easy to forget or mishandle a disposable object(entity), either by multiple dispose, or forgetting to dispose without any feedback/warning.
Its basically left to the user to be careful in memory management, especially for cases of nested calls, creation of managed memory deep within the call stack but returned, made use of and disposed at a much higher point in the stack.
Disposable objects, make use of memory pools which need to be returned to the pool after usage.
The difficulty is knowing when to return, especially if the object is created and then passed(owned) by a different object.
This behavior is quite similar to rusts idea of ownership and memory management.
Maybe there's a solution along those lines ?
Actual behavior
Running all Nethermind tests locally and in parallel seems to cause
Exit code is 134 (Unhandled exception. System.InvalidOperationException: ArrayPoolList hasn't been disposed. Created at Nethermind.Core.Collections...
Expected behavior
ArrayPools should be easier to properly disposed/managed.
Hence making it simpler to spot cases where the above error might happen or impossible to happen?
The text was updated successfully, but these errors were encountered:
obasekiosa
changed the title
Find a way to better manage Disposable Entities.
Find a way to better manage Disposable(Array Pool List) Entities.
Sep 23, 2024
Description
This is more of a ux/optimazation issue.
Right now Disposable
(Array Pool List)
entities in the code base are disposed/handled based on the discretion of the dev.It is very easy to forget or mishandle a disposable object(entity), either by multiple dispose, or forgetting to dispose without any feedback/warning.
Its basically left to the user to be careful in memory management, especially for cases of nested calls, creation of managed memory deep within the call stack but returned, made use of and disposed at a much higher point in the stack.
Disposable objects, make use of memory pools which need to be returned to the pool after usage.
The difficulty is knowing when to return, especially if the object is created and then passed(owned) by a different object.
This behavior is quite similar to
rusts
idea of ownership and memory management.Maybe there's a solution along those lines ?
Actual behavior
Running all Nethermind tests locally and in parallel seems to cause
Exit code is 134 (Unhandled exception. System.InvalidOperationException: ArrayPoolList hasn't been disposed. Created at Nethermind.Core.Collections...
Expected behavior
ArrayPools should be easier to properly disposed/managed.
Hence making it simpler to spot cases where the above error might happen or impossible to happen?
The text was updated successfully, but these errors were encountered: