OutOfMemoryException异常时有大量的可用内存 [英] OutOfMemoryException when a lot of memory is available

查看:458
本文介绍了OutOfMemoryException异常时有大量的可用内存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个是5(服务器)节点上运行(16核心,128 GB的内存)的应用程序加载的每台机器上近70 GB的数据。本申请被分布并提供并发客户端,因此,有很多套接字用法。同样,对于多线程之间的同步,也有正在使用一些同步技术,大多采用 System.Threading.Monitor

We have an application that is running on 5 (server) nodes (16 cores, 128 GB Memory each) that loads almost 70 GB data on each machine. This application is distributed and serves concurrent clients, therefore, there is a lot of sockets usage. Similarly, for synchronization between multiple threads, there are a few synchronization techniques being used, mostly using System.Threading.Monitor.

现在的问题是,虽然应用程序运行和数据,即使这些服务器节点和 OutOfMemoryException异常之间的客户端和服务器之间,一个或两个服务器机器开始接受旅游有40 +%的内存仍然可用。我们有这个异常是从非托管code未来的感觉。虽然,我们不能直接做任何非托管的呼叫,我们已经看到,在OOM异常堆栈跟踪的最后一个电话永远是一个框架,呼叫内部调用非托管的code。

Now the problem is that while application is running and the data is traveling between these server nodes and between clients and servers, one or two server machines start receiving OutOfMemoryException even though there is 40+% memory still available. We have a feeling that this exception is coming from unmanaged code. Although, we are not directly making any unmanaged calls, we have seen that the last call in the OOM exception stack trace is always a framework call that internally calls unmanaged code.

下面是几个例子。

Exception of type 'System.OutOfMemoryException' was thrown.
   at System.Threading.Monitor.ObjPulseAll(Object obj)
   ....

Exception of type 'System.OutOfMemoryException' was thrown.
   at System.Threading.Monitor.ObjWait(Boolean exitContext, Int32 millisecondsTimeout, Object obj)
   at System.Threading.Monitor.Wait(Object obj, TimeSpan timeout)
   ....

我们无能这里来是什么原因造成了这个问题。我们已经引起GC在这些机器上多次但这似乎也并没有帮助。

We are clueless here as to what is causing this issue. We have induced GC on these machines multiple times but that also doesn't seem to help.

任何帮助将是AP preciated ..

Any help would be appreciated..

编辑:

下面是一些更多的细节;

Following are some more details;

  • 在应用程序运行在64位的过程。
  • 在Windows Server 2012中R2
  • 在.NET框架4.5
  • 启用服务器GC
  • AllowLargeObject 标志设置。
  • Application is running in x64 process.
  • Windows Server 2012 R2
  • .NET Framework 4.5
  • Server GC enabled
  • AllowLargeObject flag is set.

EDIT2:请注意,这不是一个内存泄漏。 70 GB的进程大小此处是有效的。

Please note that this is not a memory leak. 70 GB process size is valid here.

推荐答案

一些preliminary问题,其他用户建议是很酷,但你认为是懒惰和分析你的应用程序?

Some of the preliminary questions that other users have suggested are cool, but have you considered being lazy and profiling your app?

我能想到的蚂蚁探查从展鹏或dotmemory从JetBrains公司,下面的链接。

I can think of Ants profiler from Redgate or dotmemory from JetBrains, links below.

<一个href="http://www.red-gate.com/products/dotnet-development/ants-memory-profiler/">http://www.red-gate.com/products/dotnet-development/ants-memory-profiler/

https://www.jetbrains.com/dotmemory/

这篇关于OutOfMemoryException异常时有大量的可用内存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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