内存不足异常问题 [英] Out of memory Exception problem

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

问题描述

大家好!



我4个月内出现内存异常问题。我的客户使用webservice,他们想让我测试他们的web服务。在他们的web服务中,有一个函数调用上传。我在同时上传的1500个用户上测试了该功能。我尝试了visual studio(GC)的垃圾收集功能。用2mb的文件,没有异常,但是8mb的文件仍然有内存不足的例外。我已经尝试了很多次和很多解决方案,但仍然发生了。我现在要疯了。当上传正在进行时,我看了所有测试计算机的内存,但内存不存在。所以我认为问题来自webservice和服务器。但我的客户说,我必须改进从webservice和服务器到他们的原因。我现在要疯了。你们对此有什么独处吗?



谢谢和最好的问候,

Hi guys!

I got out of memory exception problem for 4 months. My client use webservice, they wanna me test their webservice. In their webservice, there is a function call upload. I test that function on 1500 users who uploaded at the same time. I tried garbage collection function of visual studio (GC). With 2mb of file, there is not exception, but with 8mb of file there is still out of memory exception. I have tried many times and a lot of solutions but still happened. I gonna crazy now. When upload is on going, I watched memory of all test computers but memory is not out of. So I think that problem is from webservice and server. But my client said that i have to improve those reasons which is from webservice and server to them. I''m gonna crazy now. Do you guys have any solotions for this?

Thanks and best regards,

推荐答案

首先,得到摆脱GC垃圾。这并不是你一点都不好,而且你并没有真正断言任何两次调用GetTotalMemory。



我特别喜欢你回忆的部分文件的所有字节然后立即全部抛出。



其次,这似乎不是抛出错误的实际代码。它似乎正在做的只是填充类结构,除非在作业对象内部有一些时髦的东西,否则它们都不会抛出OutOfMemory异常,代码其中我们看不到。



您必须提供错误引发的行以缩小此范围。我知道你说这是文件上传的时间,但是在客户端或服务器端抛出了错误?
First, get rid of the GC garbage. It doesn''t you no good at all and you''re not really asserting anything with those two calls to GetTotalMemory.

I especially like the part where you reall all the bytes of a file and then immediately throw it all out.

Second, this doesn''t appear to be the actual code throwing the error. All it appears to be doing is filling in a class structure, none of which will throw an OutOfMemory exception unless there''s something funky going on inside the job object, the code of which we cannot see.

You would have to supply the line on which the error throws to narrow this down. I know you said it''s when the file gets uploaded, but is the error thrown on the client side or on the server side??


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

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