Click here to Skip to main content
15,885,309 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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,
Posted
Comments
[no name] 15-Apr-13 22:16pm    
Solutions for an out of memory exception on code we can't see? Nope.
gundamf91 15-Apr-13 22:24pm    
Our client does not public code, I just use webservice's function to test. Additional, I have to use vps to connect their webservice and network rather slow when connect to vps.
[no name] 15-Apr-13 22:44pm    
So how does your client expect you to debug their code for them if you do not have access to it? Much less how you would expect anyone half way around to the world to mystically know what the problem is without seeing the relevant code.
gundamf91 15-Apr-13 22:26pm    
Additional, I have to use vps to connect their webservice and network rather slow when connect to vps.
Dave Kreskowiak 15-Apr-13 22:31pm    
It's a "VPN", not "vps". Virtual Private Network. There's no such thing as a "vps".

For an Out Of Memory problem, there could be any one of a hundred different causes. Without seeing the code, it's impossible for anyone to give a "solution".

All anyone can tell you is you have to be able to debug the deployed code somehow. If you don't have access to it, there's nothing you can do. You can start by getting a crash dump and using the Debugging Tools for Windows. Hopefully, you have access to the symbol files. If not, this gets MUCH harder.

If you don't know how to use the Debuggers, you're in world of hurt as this is not something you're going to learn or be walked through in a few forum posts.





1 solution

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??
 
Share this answer
 
Comments
gundamf91 16-Apr-13 0:52am    
Thanks, here is the problem, when visual studio thrown that exception, it didn't said that exception is from client side or server side, when I debugg my code there was not any bug. So do you have any solution to check that exception from client side or server side?
In another idea, I found that exception relate to limit ram of .net framework. But I can't find any official document of this article. Could you please provide some documents about limited of ram of .net framework?
Dave Kreskowiak 16-Apr-13 8:30am    
This is the only code you're running? Then it's your client code. There are two possibilities that I see. Either ReadAllBytes is trowing because you're reading an entire file into memory (which you're completely ignoring the contents of so it's pointless to read the file at all!) or your object is so large that serializing it is running the system out of memory.

Get rid of the TRY block and it'll stop on the line that's throwing the error.
Dave Kreskowiak 16-Apr-13 8:32am    
The available RAM in the .NET Framework is only limited byt your system. The only hard limit that isn't very easy to find is no single object can be larger than 2GB of memory.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900