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
The implementation of FutharkContext does not at any point call futhark_context_free() or futhark_context_config_free(). This
means that the actual Futhark context object is not freed when the FutharkContext Rust object is destroyed. GPU resources may thus be
leaked until the process ends entirely and they are reclaimed by the
operating system.
I recommend adding an implementation of the Drop trait for FutharkContext, which should call futhark_context_free() and futhark_context_config_free() (in that order). If this is done,
then the implementation of the Copy and Clone
traits should probably be removed.
The text was updated successfully, but these errors were encountered:
I have a few ideas on how to resolve this. One would be to use Arcs to refer to the context from other objects and first free the Context when there are no objects that refer to it.
Another way would be that onjects have Weak pointers to the Context which have a strong Arc this way the context can get freed when there are still objects alive. We could then have a new error that can happen when the context have been freed.
And finally there is also the original idea of using borrowed references in objects, which will work, but may not be nice to work with.
The implementation of
FutharkContext
does not at any point callfuthark_context_free()
orfuthark_context_config_free()
. Thismeans that the actual Futhark context object is not freed when the
FutharkContext
Rust object is destroyed. GPU resources may thus beleaked until the process ends entirely and they are reclaimed by the
operating system.
I recommend adding an implementation of the
Drop
trait forFutharkContext
, which should callfuthark_context_free()
andfuthark_context_config_free()
(in that order). If this is done,then the implementation of the
Copy
andClone
traits should probably be removed.
The text was updated successfully, but these errors were encountered: