Only release build exe uses temporarily 1gb unmanaged ram
MacTee
Posts: 3
Hallo,
we have noticed a strange behavior in our .net 4.0 WinForm app.
When we start the app everything is fine, but when we open an additional WinForm the app allocates 1gb of unmanaged ram and frees it just befor it open the new window.
This takes about 20 sec.
The strange thing is that this only happens when we build the app with release configuration. In a debug build exe or when we run the release exe with VS to debug it, there is no such memory allocation and no waiting time!
We tried to find some hints with your ANTS Memory Profiler, but we couldnt figure out what the problem is.
Maybe you can help us and take a look on the results
https://www.dropbox.com/s/ei3qvznts1vqc5a/Snapshot.zip?dl=0
to give us a hint what wents wrong.
Sidenote: We are using alot of DevExpress components.
Thanks!
Bastian
we have noticed a strange behavior in our .net 4.0 WinForm app.
When we start the app everything is fine, but when we open an additional WinForm the app allocates 1gb of unmanaged ram and frees it just befor it open the new window.
This takes about 20 sec.
The strange thing is that this only happens when we build the app with release configuration. In a debug build exe or when we run the release exe with VS to debug it, there is no such memory allocation and no waiting time!
We tried to find some hints with your ANTS Memory Profiler, but we couldnt figure out what the problem is.
Maybe you can help us and take a look on the results
https://www.dropbox.com/s/ei3qvznts1vqc5a/Snapshot.zip?dl=0
to give us a hint what wents wrong.
Sidenote: We are using alot of DevExpress components.
Thanks!
Bastian
Comments
Thanks for your post!
It seems the memory increase is from the unmanaged stacks (and a bit from the CLR itself).
If you take a look at the unmanaged memory value in the pie chart (773 MB) vs the sum of unmanaged memory memory by module (about 130 MB), there is a large discrepancy. This is because the module breakdown doesn't include the size of the unmanaged stacks.
Are there a lot of threads during the spike?
Jessica Ramos | Product Support Engineer | Redgate Software
Have you visited our Help Center?
thanks for your replay!
No, there are just two threads, the GUI thread and a BackgroudWorker thread to get data from a WebService/DB (but I'm not shure if the second thread has started already).
The strange thing is that this memory allocation only happens in a release build, a debug build or starting a exe within a debug session don't show such a behavoir.