G
Guest
Hi,
I hope this post will find it's way to some MS technical authority...
I am experienced with bought Unmanaged C++ and Managed code ( C# ), There
are some issues with the .NET framework that make me wonder...
Take in mind the following points:
1. Managed objects are managed by the GC through the managed heap.
2. The GC moves the physical data representation of managed objects to
reserve address space.
Problems with this logic:
******************
A. to be able to access the physical address space directly ( through
unmanaged code ) one would have to 'pin' the managed object, hence,
preventing the GC from moving the physical data around, pinning data in such
a way causes a performance degradation.
B. Passing unmanaged pointers to methods with managed Object type variables
is not possible, a managed wrapper must be created and the data should be
copied to the managed buffer, doing rapid memory coping dramatically reduce
performance...
Resolution:
********
64bit computing offers a huge address space, this makes the need for the GC
memory compacting mechanism unnecessary as the address-space is so large,
disabling memory compaction will cancel the need of pinning managed objects (
as they will be pinned anyhow ) and will enable more efficient data transfer
between managed and unmanaged code ( as referred to in B. )
Nadav
nadavrub AT gmail DOT com
I hope this post will find it's way to some MS technical authority...
I am experienced with bought Unmanaged C++ and Managed code ( C# ), There
are some issues with the .NET framework that make me wonder...
Take in mind the following points:
1. Managed objects are managed by the GC through the managed heap.
2. The GC moves the physical data representation of managed objects to
reserve address space.
Problems with this logic:
******************
A. to be able to access the physical address space directly ( through
unmanaged code ) one would have to 'pin' the managed object, hence,
preventing the GC from moving the physical data around, pinning data in such
a way causes a performance degradation.
B. Passing unmanaged pointers to methods with managed Object type variables
is not possible, a managed wrapper must be created and the data should be
copied to the managed buffer, doing rapid memory coping dramatically reduce
performance...
Resolution:
********
64bit computing offers a huge address space, this makes the need for the GC
memory compacting mechanism unnecessary as the address-space is so large,
disabling memory compaction will cancel the need of pinning managed objects (
as they will be pinned anyhow ) and will enable more efficient data transfer
between managed and unmanaged code ( as referred to in B. )
Nadav
nadavrub AT gmail DOT com