B
Brian Anderson
Hello,
I have a native, C++ console app that uses ~26MB of RAM when it runs.
It uses quite a lot of RAM to make some math but will never xceed 26MB.
Now I've made a dll out of this code and use it with DllImport in a C#
console application.
Basically I just access main() and pass my parameters.
w00t! RAM used by the C# app is now 228 MB !
No matter if I use DllImport in ASP.NET or any .NET application, RAM use
goes evil.
1)
extern "C" __declspec(dllexport) int main(int argc, char** argv) {
2)
[DllImport("xmaths.dll")]
public static extern int main(int argc, string[] argv);
What is .NET doing here ? The DllImport works fine as I get the expected
result fom my Dll but it's impossible to use this on a production server.
The response time is fast, no 100% CPU use. Everything is fine but RAM
taken.
Is there a trick to tell C# to stop going wild ?
I have a native, C++ console app that uses ~26MB of RAM when it runs.
It uses quite a lot of RAM to make some math but will never xceed 26MB.
Now I've made a dll out of this code and use it with DllImport in a C#
console application.
Basically I just access main() and pass my parameters.
w00t! RAM used by the C# app is now 228 MB !
No matter if I use DllImport in ASP.NET or any .NET application, RAM use
goes evil.
1)
extern "C" __declspec(dllexport) int main(int argc, char** argv) {
2)
[DllImport("xmaths.dll")]
public static extern int main(int argc, string[] argv);
What is .NET doing here ? The DllImport works fine as I get the expected
result fom my Dll but it's impossible to use this on a production server.
The response time is fast, no 100% CPU use. Everything is fine but RAM
taken.
Is there a trick to tell C# to stop going wild ?