473,378 Members | 1,110 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Getting Out of memory exception even when the memory is not full

Hi,
I am ruuning to out of memory exception , My system has RAM of 4 GB
and virtual memory paging size set to 4GB .When I check the memory
occupied by the process during the exception , it is less ( around 500
MB and peak Memory usage 800MB , even the total memory of the system
is not high . what are passing use cases where the system leads to out
of memory exception ?
I am using two process for the program and the out of memory occuring
in the second process.

Thanks in Advance

Regards
Aravind

Aug 3 '05 #1
7 18891
Aravind,

How do you know that the memory is not completly used.

Cor
Aug 3 '05 #2
Aravind <ar*************@gmail.com> wrote:
I am ruuning to out of memory exception , My system has RAM of 4 GB
and virtual memory paging size set to 4GB .When I check the memory
occupied by the process during the exception , it is less ( around 500
MB and peak Memory usage 800MB , even the total memory of the system
is not high . what are passing use cases where the system leads to out
of memory exception ?
I am using two process for the program and the out of memory occuring
in the second process.


There are other situations in which you can get an
OutOfMemoryException, I believe - if you "leak" a lot of Windows
handles, for instance, I think you can get that exception. The most
common cause of this in my experience is using large numbers of images
and not disposing of them. Could that be the problem?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Aug 3 '05 #3
Jon,

In my opinion it is easier to get an Out of memory exception with code like
beneath.

\\\\
Public Class Main
Public Shared Sub main()
Dim a As New Main
End Sub
Public Sub New()
Dim c As New ArrayList
For i As Integer = 0 To 999999999
c.Add(c)
Next
Dim b As New Main
End Sub
End Class
///

I made this because that I was curious what the taskmanager would do with
this.

Cor
Aug 3 '05 #4
Aravind,
Another way to run out of memory without using much is to create too
many threads. Since each thread normally reserves 1 meg of memory space,
creating 2000 threads will reserve all of available user memory while
actually only consuming about 10 Meg.
Bob Milton

"Aravind" <ar*************@gmail.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
Hi,
I am ruuning to out of memory exception , My system has RAM of 4 GB
and virtual memory paging size set to 4GB .When I check the memory
occupied by the process during the exception , it is less ( around 500
MB and peak Memory usage 800MB , even the total memory of the system
is not high . what are passing use cases where the system leads to out
of memory exception ?
I am using two process for the program and the out of memory occuring
in the second process.

Thanks in Advance

Regards
Aravind

Aug 3 '05 #5
Hi Cor,

When I check the memory occupied by the task manager , the process is
not occupying huge memory ( around 500
MB and peak Memory usage 800MB ) for my RAM 4GB . Hence I had the
confusion.

When the process is reaching out of memory it should show the memory
usage of the process in the task manager right ?

Regards
Aravind.
*** Sent via Developersdex http://www.developersdex.com ***
Aug 3 '05 #6
Please don't multipost, I replied in the Csharp NG.

Willy.

"Aravind" <ar*************@gmail.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
Hi,
I am ruuning to out of memory exception , My system has RAM of 4 GB
and virtual memory paging size set to 4GB .When I check the memory
occupied by the process during the exception , it is less ( around 500
MB and peak Memory usage 800MB , even the total memory of the system
is not high . what are passing use cases where the system leads to out
of memory exception ?
I am using two process for the program and the out of memory occuring
in the second process.

Thanks in Advance

Regards
Aravind

Aug 3 '05 #7
> When I check the memory occupied by the task manager , the process is
not occupying huge memory ( around 500
MB and peak Memory usage 800MB ) for my RAM 4GB . Hence I had the
confusion.

When the process is reaching out of memory it should show the memory
usage of the process in the task manager right ?

No,

However I saw that Willy has answered you in the Csharp newsgroup. He is a
kind of the specialist in this kind of questions.

In addition to him please don't multipost, crossposting to the dotnet
newsgroups is if done well not a problem at all.

Cor
Aug 4 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Aravind | last post by:
Hi, I am ruuning to out of memory exception , My system has RAM of 4 GB and virtual memory paging size set to 4GB .When I check the memory occupied by the process during the exception , it is less...
25
by: Zeng | last post by:
I finally narrowed down my code to this situation, quite a few (not all) of my CMyClass objects got hold up after each run of this function via the simple webpage that shows NumberEd editbox. My...
2
by: Liverpool fan | last post by:
I have a VB .NET windows application that is throwing an intermittent 'out of memory' error. Here is the call stack. Out of memory. at System.Drawing.Graphics.FromHdcInternal(IntPtr hdc) at...
81
by: Peter Olcott | last post by:
It looks like System::Collections::Generic.List throws and OUT_OF_MEMORY exception whenever memory allocated exceeds 256 MB. I have 1024 MB on my system so I am not even out of physical RAM, much...
12
by: Premal | last post by:
Hi, I tried to make delete operator private for my class. Strangely it is giving me error if I compile that code in VC++.NET. But it compiles successfully on VC++6.o. Can anybody give me inputs...
4
by: Daniel | last post by:
is there some per-process-limit on memory in .net processes? is there any way to increase it? i keep getting System.OutOfMemoryException when my box has 8 gigs of unused memory.
2
by: Scott | last post by:
I'm debugging an xmlrpc client/server application. Often when an exception occurs in the server, I receive only a very short error message on the client. For example: xmlrpclib.Fault: <Fault 1:...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.