无法分配ByteArray(400-500kb) - OutOfMemoryException

时间:2013-02-27 12:40:29

标签: c# memory out-of-memory

我有一个C#应用程序偶尔会在尝试分配ByteArray时抛出OutOfMemoryException(不是很大,通常是400-500kb)。                                                   与几个WCF服务进行通信,但是我不确定这是否会导致问题。我们打印出内存使用情况,但没有明显的错误。该应用程序资源丰富,其内存使用率很高,但不是很高,我们得到一个OOE。

CLR有问题吗? 你知道我们为什么会看到这个例外吗? 可能是由于WCF配置?(例如maxBuffer属性等)

2013-02-27 12:01:38,489 [54] INFO  - Counters: CPU: 215, Gen0: 6291456, Gen1: 482488, Gen2: 8.201334E+08, LOH: 4.410252E+08, .Net: Private Bytes: 1423708160, Paged: 1424003072,
2013-02-27 12:01:43,504 [34] INFO  - Counters: CPU: 291.2773, Gen0: 4194300, Gen1: 1232084, Gen2: 8.494915E+08, LOH: 4.579806E+08, .Net: Private Bytes: 1469743104, Paged: 1470038016,
2013-02-27 12:01:48,520 [55] INFO  - Counters: CPU: 285.6698, Gen0: 6291456, Gen1: 662016, Gen2: 8.767135E+08, LOH: 4.999192E+08, .Net: Private Bytes: 1538347008, Paged: 1538641920, 
2013-02-27 12:01:53,536 [55] INFO  - Counters: CPU: 218.3801, Gen0: 6020000, Gen1: 296772, Gen2: 8.874388E+08, LOH: 5.055583E+08, .Net: Private Bytes: 1556791296, Paged: 1557082112, 
System.InsufficientMemoryException: Failed to allocate a managed memory buffer of 459955 bytes. The amount of available memory may be low. ---> System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
   at System.ServiceModel.Diagnostics.Utility.AllocateByteArray(Int32 size)
   --- End of inner exception stack trace ---

0 个答案:

没有答案