Windows服务器上非托管VC ++应用程序的内存消耗 [英] Unmanaged VC++ Application's memory consumption on windows server

查看:86
本文介绍了Windows服务器上非托管VC ++应用程序的内存消耗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,所以我有一个非常大型的多线程非托管c ++应用程序(服务器),它可以在Windows 2003服务器上运行.它为执行各种业务逻辑的20-50个并发用户托管会话...有时由于对象/会话缓存之类的事情(由于用户在客户端中打开大量用户的窗口),它可能会占用大量内存. (每个窗口都有一个单独的服务器会话".

OK, so I have a very large multi-threaded unmanaged c++ application (server) that runs on a windows 2003 server. It hosts sessions for 20-50 concurrent users doing all sorts of business logic... At times it can be using a very large amount of memory due to things like object/session caching due to users having large numbers of windows open in the clients (each window has a separate server 'session'.

我们通常会看到消耗超过5-600 MB的物理内存和5-600 MB的虚拟内存.一旦到达这一点,我们似乎开始出现内存不足"错误.

We routinely see consumption of more than 5-600 MB physical memory and 5-600 MB of virtual memory. Once it gets to this point we seem to start having 'out of memory' errors.

现在,我知道Windows在感觉到需要释放物理内存时将开始页面错误,而且Win32应用程序通常最多只能分配最大4GB的内存,实际上只有2GB的内存可以分配.可供应用程序实际用于用户模式"地址空间的数据,甚至在加载其他库后的可用空间…甚至更少……我不确定用户模式"的内存使用情况是否是报告的任务管理器...

Now I know that Windows will start page-faulting when it feels it needs to free up physical memory, and also that win32 applications normally are only able to allocate up to a maximum of 4GB worth of memory, really only with 2GB of that available for actual use by the application for 'user-mode' address space, and even less of that after other libraries are loaded... I'm not sure if the 'user-mode' memory usage is what is reported on the Task Manager...

所以无论如何,我真正的问题是:

如何确定我的应用程序可以访问多少用户模式内存以及在任何给定时间(最好是从应用程序外部,即某些Windows管理工具)使用了多少内存?

[edit]查看Process Explorer和网站后,看起来值'Virtual Size'是应用程序可以访问的内存量的值.

[edit] After looking at the Process Explorer and the website, it looks like the value 'Virtual Size' is the value of how much memory the application has access to.

推荐答案

听起来像
(来源:
microsoft.com )


(source: microsoft.com)

说明:

曾经想知道哪个程序有一个 特定文件或目录是否打开?现在 你可以找到.流程浏览器 向您显示有关哪个的信息 句柄和DLL进程已打开 或已加载.

Ever wondered which program has a particular file or directory open? Now you can find out. Process Explorer shows you information about which handles and DLLs processes have opened or loaded.

Process Explorer显示包括 的两个子窗口.顶窗 始终显示当前列表 活动进程,包括名称 他们拥有的帐户,而 底部显示的信息 窗口取决于模式 Process Explorer在:如果在 手柄模式,您将看到手柄 在顶部选择的过程 窗户已经打开;如果Process Explorer 在DLL模式下,您会看到DLL和 内存映射文件的过程 已加载.流程浏览器也有 强大的搜索功能 快速向您展示哪些流程 特定的句柄打开或DLL 加载.

The Process Explorer display consists of two sub-windows. The top window always shows a list of the currently active processes, including the names of their owning accounts, whereas the information displayed in the bottom window depends on the mode that Process Explorer is in: if it is in handle mode you'll see the handles that the process selected in the top window has opened; if Process Explorer is in DLL mode you'll see the DLLs and memory-mapped files that the process has loaded. Process Explorer also has a powerful search capability that will quickly show you which processes have particular handles opened or DLLs loaded.

流程的独特功能 资源管理器使其对跟踪有用 DLL版本问题或处理 泄漏,并提供对 Windows和应用程序的工作方式.

The unique capabilities of Process Explorer make it useful for tracking down DLL-version problems or handle leaks, and provide insight into the way Windows and applications work.


如果您正在寻找有关终端服务器特定信息的更多信息,我一直在关注一个程序员的博客,该博客正在发布该工具的beta版本,我相信它将完全满足您的需求.它是经过改进的TSAdmin.他称之为TSAdminEx.


If you are looking for more info in terms of terminal-server specific info, I've been following the blog of a programmer that is releasing a beta of a tool that I believe will fit your needs perfectly. It is an improved TSAdmin. He calls it TSAdminEx.

请参见下面的屏幕截图,并单击此处以进行操作了解有关它的更多信息并获得测试版.它是免费软件,顺便说一句.

See below for a screenshot, and click here to learn more about it and to get the beta. It's free software, BTW.

这篇关于Windows服务器上非托管VC ++应用程序的内存消耗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆