开发者

App can report it's own memory usage?

I have a console app that watches a folder (Manual code... not using the .Net classes) for file changes, and then does some moving of files based on rules.

However, it seems to shut down by it's self. Crashes, I guess. Now, it's a home project, and I have a 'Hit a key to end' option. I also have a 3 year old walking around. So开发者_JS百科, it might not be code issue related. However, as a learning exercise, is there a way to get the memory usage of the app? So, I want to know the total amount of memory being used by my app.


Try http://msdn.microsoft.com/en-us/library/system.appdomain.monitoringsurvivedmemorysize.aspx

You can also use Process.GetCurrentProcess() and then all memory properties


you could use the System.Diagnostic classes like Process:

Process Properties

do you anyway use a logging system to log all exceptions of your app and a global exception handler for otherwise unhandled exceptions?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜