dotnetex icon indicating copy to clipboard operation
dotnetex copied to clipboard

Storing References to unmanaged memory + GC != love

Open damageboy opened this issue 10 years ago • 3 comments

I have a similar project (in some ways) to this: https://github.com/damageboy/daemaged.managedhell

One of the reasons I had to abandon the use of this (namely allocating .NET objects in unmanaged memory) was that as the use of the managed references to unmanaged memory lead to all kinds of unpredictable GC crashes... Have you ever seen anything like this in with your library?

damageboy avatar May 16 '15 16:05 damageboy

I dont use them in my projects, only as sample on conferences that this possible. Still need some investigations to solve this problem.

sidristij avatar May 21 '15 06:05 sidristij

I haven't been able to solve this problem personally.

The GC has a temperamental issue, from what I can tell with pointers that seem to point to CLR object but not in the CLR heaps.

Now that the GC code is actually open-sourced, I have a chance of maybe possible getting a meaningful stacktrace of this issue and maybe hacking it away... :)

damageboy avatar May 21 '15 12:05 damageboy

=)) wow, good luck =) I hope, I'll find time to do it also =). If you'll be first, please note what way you'll find

sidristij avatar May 21 '15 17:05 sidristij