Skip to main content
Filter by
Sorted by
Tagged with
3 votes
2 answers
210 views

I faced a problem when I tried to write into virtual memory in C# program, I allocated the memory using VirtuAlloc function, and then write 10 bytes array into the memory using Marshal.Copy function, ...
Amr Alasmer's user avatar
0 votes
1 answer
235 views

I try to call manually mapped AOT-compiled .NET dll. When i create delegate to function pointer and call it, it throws exception "Fatal error. Invalid Program: attempted to call a ...
Илья's user avatar
0 votes
2 answers
634 views

Is there a way to retrieve the total amount of native memory usage from a running C# application (either from within C# or an external CLI tool)? Something equivalent to the output of the non heap ...
andresp's user avatar
  • 1,664
0 votes
2 answers
3k views

I have an instance of Span<byte> which I would like to copy to unmanaged memory pointed by IntPtr. If I had a byte[], this would be an easy job, just call Marshal.Copy: I know I can convert ...
FICHEKK's user avatar
  • 859
0 votes
1 answer
1k views

I have an IntPtr which is a pointer to an array of structs, and I'm trying to convert it to the array. I tried Marshal.Copy(srcIntPtr, destIntPtrArray, 0, destIntPtrArray.Length); but after doing the ...
MushroomTip's user avatar
0 votes
1 answer
372 views

NOTE: My case is in the ecosystem of an old API that only work with Strings, no modern .NET additions. So I have a strong need to have mutable string that has no allocations. String is updated every X ...
KreonZZ's user avatar
  • 343
1 vote
1 answer
2k views

i am kind of stumped on a memory leak in our application. It only happens on the customers machines, or at least tests to reproduce it on my machine have failed. Luckily our application collects some ...
Thanatos's user avatar
0 votes
1 answer
340 views

I have been tasked to update a legacy 32-bit C# application to support converting 4K/UHD images (jpg, tiff, etc.) to an YUV image for further processing. The way we have accomplish converting SD/HD ...
Ivan Plascencia's user avatar
0 votes
0 answers
179 views

An unmanaged pointer is passed to a method of a class in C#. Before manipulating, I need to make sure that the pointer is allocated with the claimed size and is still valid (not freed yet). How is it ...
hamidi's user avatar
  • 1,915
1 vote
2 answers
7k views

I have a windows service to receive emails that uses OpenPop. However memory usage goes up to 8G about 3 days after a restart. Operation staff gives me a dump file, So I use windbg to analysis it. ...
Laball Lee's user avatar
0 votes
1 answer
38 views

I'm having issues trying to understand a memory usage diagram, hopefully someone more experienced in memory management will be able to tell if I'm facing a memory leak problem or not To perform this ...
user949050's user avatar
0 votes
0 answers
79 views

I have a COM dll (native) that I want to use it in my c# project, this dll has a function that get one IntPtr parameter like this : int GetParameter(out paramCount,IntPtr paramInterfaceArray) when I ...
user2706746's user avatar
0 votes
0 answers
39 views

I have a generic class class UnmanagedArray<T> where T: struct { IntPtr _backing; // unmanaged memory // some constructors and others methods // very slow but I don't care ...
Regis Portalez's user avatar
17 votes
1 answer
5k views

With the introduction of Memory, Span and ArraySegment in C# 7.2, I was wondering if I could represent an unmanaged array as an enumerable object, that lives on the heap. This latter requirement ...
Red Riding Hood's user avatar
0 votes
1 answer
269 views

I an working with API calls to advapi32.dll for managing Windows Saved Credentials in order to automate certain windows applications which can use saved credentials, which is working fine. I am ...
Ashigore's user avatar
  • 4,686
1 vote
1 answer
281 views

I have simplified my original issue into this test. Using this class: public class Unmanaged : IDisposable { private IntPtr unmanagedResource; public Unmanaged() { this....
James Soult's user avatar
0 votes
1 answer
556 views

I'm pinning and unpinning with: GCHandle pinArray(object a) { return GCHandle.Alloc(a, GCHandleType.Pinned); } void unpinArray(GCHandle h) { h.Free(); } ...
huseyin tugrul buyukisik's user avatar
6 votes
1 answer
1k views

Continuing my F# performance testing. For some more background see here: f# NativePtr.stackalloc in Struct Constructor F# NativePtr.stackalloc Unexpected Stack Overflow Now I've got stack arrays ...
Researcher's user avatar
  • 1,046
3 votes
1 answer
385 views

I'm doing some F# performance testing and am trying to create an array on the stack rather then the heap (value vs reference type). I am using NativePtr.stackalloc to allocate memory on the stack. ...
Researcher's user avatar
  • 1,046
0 votes
0 answers
254 views

I have class called Parent : Class Parent { String Name; IntPtr Childs; // this pointer actual type is 'Array of Child' and it was storred as unmanned array int ChildsCount;// count of '...
Humam Helfawi's user avatar
1 vote
0 answers
161 views

I have not been able to find a satisfactory explanation as to why calling GC.Collect before a large unmanaged allocation (in my case, before creating a large (~250Mb) DirectX resource) prevents an out-...
PaulS's user avatar
  • 709
1 vote
2 answers
1k views

I'm quite confused about how to pass handle to my managed object from .Net to unmanaged code. Now I'm developing kind of "driver" for Oracle Siebel CRM using C#. And how i faced with problem about how ...
Anton Antonenko's user avatar
1 vote
0 answers
72 views

I wanted to know whether sending a locked Bitmap's BitmapData.Scan0 field to unmanaged C++ could be an issue. Here's how I do it: From C#.NET: public class BmpTest{ Bitmap bmp = new Bitmap(); ...
Sergio Basurco's user avatar
0 votes
1 answer
324 views

I currently have some c++ code which processes 'char ***myArray' much faster than any other method for string comparison. I'm also wrapping my c++ into a DLL and calling functions from a C# GUI which ...
CodeMonkey's user avatar
3 votes
1 answer
2k views

Is there a way to marshal a structure (possibly stored in a TypedReference) to unmanaged memory without actually boxing it? The type of the structure isn't known at runtime, so I can't use the generic ...
IS4's user avatar
  • 13.5k