473,395 Members | 1,504 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,395 software developers and data experts.

Getting an out of memory error

RD
I have a VBV.NET application that runs on a timer to do a job at one hour
intervals.
Basically the sequence is as follows
the timer event fires
1- the timer get turned off
2- the code then checks to see if we're just changed hour from when the
previous transfer session took place
IF yes
the code executes an FTP transfer from an FTP site.
When the transfer is completed the file received is parsed (it's a comma
separated ASCII file) line by line and the dat is transferred to SQL server
files.
Remember the hour part of the current transfer session time
end if
Turn the timer on again

All the code can execute faultlessly for a week doing a transfer every hour
on the hour or it can try the first one and stop dead in it's tracks with an
out of memory error message. Never at the same place but always the same
code 80004008. We had logs running tracing the program execution and writing
every procedure to text files and nothing gives us an inkling that it's
going to fail.

All through the code we've been very carefull to close every ADO .Net
connection every time we open one and tried to always set unused objects to
nothing explicitly. All I can come up with as a cause is the new garbage
collector is going out on an illegal strike <GGGG>.

This has been bugging me for over two months in an operational test phase
and I'm wondering if there is a practical way to trace what is happening
with memory useage over time, keeping a record that we can correlate to when
the errors and trying to figure out exactly why an app that runs alone
usoing about 15% of the available RAM on a machine suddenly and unexpectedly
runs out of memory and does so in a totally unpredictable way.

Any help would be immensely appreciated.

MS if you're monitoring this thread, do you think there might be <shudder> a
<NO NO DON'T SAY IT> bug in the garbage collector < SORRY, SORRY MOST ABJECT
APOLOGIES>. What can I do to make this relaible. This is a vital busines
process that must run unattended 24 7 365.

Bob


Nov 20 '05 #1
3 3000
On 2004-03-04, RD <no****@nospam.net> wrote:
I have a VBV.NET application that runs on a timer to do a job at one hour
intervals.
Basically the sequence is as follows
the timer event fires
1- the timer get turned off
2- the code then checks to see if we're just changed hour from when the
previous transfer session took place
IF yes
the code executes an FTP transfer from an FTP site.
When the transfer is completed the file received is parsed (it's a comma
separated ASCII file) line by line and the dat is transferred to SQL server
files.
Remember the hour part of the current transfer session time
end if
Turn the timer on again

All the code can execute faultlessly for a week doing a transfer every hour
on the hour or it can try the first one and stop dead in it's tracks with an
out of memory error message. Never at the same place but always the same
code 80004008. We had logs running tracing the program execution and writing
every procedure to text files and nothing gives us an inkling that it's
going to fail.

All through the code we've been very carefull to close every ADO .Net
connection every time we open one and tried to always set unused objects to
nothing explicitly. All I can come up with as a cause is the new garbage
collector is going out on an illegal strike <GGGG>.

This has been bugging me for over two months in an operational test phase
and I'm wondering if there is a practical way to trace what is happening
with memory useage over time, keeping a record that we can correlate to when
the errors and trying to figure out exactly why an app that runs alone
usoing about 15% of the available RAM on a machine suddenly and unexpectedly
runs out of memory and does so in a totally unpredictable way.

Any help would be immensely appreciated.

MS if you're monitoring this thread, do you think there might be <shudder> a
<NO NO DON'T SAY IT> bug in the garbage collector < SORRY, SORRY MOST ABJECT
APOLOGIES>. What can I do to make this relaible. This is a vital busines
process that must run unattended 24 7 365.

Bob


Bob...

There was a bug in the 1.0 GC. It failed to deal with the large object
heap correctly (objects over about 80K in size). So, if you had large
arrays, you could end up running into memory problems. Are you using
1.0 or 1.1? As for a problem with the 1.1 GC, I haven't heard of one
and I have a windows service that has been running flawlessly for quite
some time that talks to an sql server database...

By the way, explicitly setting objects to nothing on the local scope
isn't really going to do anything for you :). Are you sure you are
calling Close/Dispose on all your objects that implement these methods?

Another place to look is if your using any COM components or P/Invoke
calls. Those are good places for memory leaks. You might want to look
into the Performance counter classes. They would probably give you a
much better means of monitoring your applications memory useage...

--
Tom Shelton [MVP]
Powered By Gentoo Linux 1.4
Help me, I'm a prisoner in a Fortune cookie file!
Nov 20 '05 #2
RD
Thanks Tom,
I went thru every single procedure that opens a connection and make sure
it's closed before exiting the procedure or function even if an exception
occurs. All my connections are only declared as new in each procedure that
uses them and closed before exiting, so in theory I should not even have to
close them. It should be done automatically as the code leaves the
procedure. Just to make doubly sure I wrote in the code to close them.

I'm not using any com components. It's all managed code.
Do you know of any samples that show how to use those Performance counter
classes?
I'm using the framework 1.1 on windows 2000 workstation with the latest SP
installed.

Thanks again,

Bob

"Tom Shelton" <to*@mtogden.com> wrote in message
news:uA**************@TK2MSFTNGP11.phx.gbl...
On 2004-03-04, RD <no****@nospam.net> wrote:
I have a VBV.NET application that runs on a timer to do a job at one hour intervals.
Basically the sequence is as follows
the timer event fires
1- the timer get turned off
2- the code then checks to see if we're just changed hour from when the
previous transfer session took place
IF yes
the code executes an FTP transfer from an FTP site.
When the transfer is completed the file received is parsed (it's a comma separated ASCII file) line by line and the dat is transferred to SQL server files.
Remember the hour part of the current transfer session time
end if
Turn the timer on again

All the code can execute faultlessly for a week doing a transfer every hour on the hour or it can try the first one and stop dead in it's tracks with an out of memory error message. Never at the same place but always the same
code 80004008. We had logs running tracing the program execution and writing every procedure to text files and nothing gives us an inkling that it's
going to fail.

All through the code we've been very carefull to close every ADO .Net
connection every time we open one and tried to always set unused objects to nothing explicitly. All I can come up with as a cause is the new garbage
collector is going out on an illegal strike <GGGG>.

This has been bugging me for over two months in an operational test phase and I'm wondering if there is a practical way to trace what is happening
with memory useage over time, keeping a record that we can correlate to when the errors and trying to figure out exactly why an app that runs alone
usoing about 15% of the available RAM on a machine suddenly and unexpectedly runs out of memory and does so in a totally unpredictable way.

Any help would be immensely appreciated.

MS if you're monitoring this thread, do you think there might be <shudder> a<NO NO DON'T SAY IT> bug in the garbage collector < SORRY, SORRY MOST ABJECT APOLOGIES>. What can I do to make this relaible. This is a vital busines
process that must run unattended 24 7 365.

Bob


Bob...

There was a bug in the 1.0 GC. It failed to deal with the large object
heap correctly (objects over about 80K in size). So, if you had large
arrays, you could end up running into memory problems. Are you using
1.0 or 1.1? As for a problem with the 1.1 GC, I haven't heard of one
and I have a windows service that has been running flawlessly for quite
some time that talks to an sql server database...

By the way, explicitly setting objects to nothing on the local scope
isn't really going to do anything for you :). Are you sure you are
calling Close/Dispose on all your objects that implement these methods?

Another place to look is if your using any COM components or P/Invoke
calls. Those are good places for memory leaks. You might want to look
into the Performance counter classes. They would probably give you a
much better means of monitoring your applications memory useage...

--
Tom Shelton [MVP]
Powered By Gentoo Linux 1.4
Help me, I'm a prisoner in a Fortune cookie file!

Nov 20 '05 #3
In article <Oe**************@TK2MSFTNGP10.phx.gbl>, RD wrote:
Thanks Tom,
I went thru every single procedure that opens a connection and make sure
it's closed before exiting the procedure or function even if an exception
occurs. All my connections are only declared as new in each procedure that
uses them and closed before exiting, so in theory I should not even have to
close them. It should be done automatically as the code leaves the
procedure. Just to make doubly sure I wrote in the code to close them.

Good - because leaving a procedure does not close the connection
immediately. The connection will only be closed the next time GC runs.
Remember, finalization is non-deterministic in .NET. Any object that
reqires a close/dispose (sockets, files, etc), should be closed before
exiting the method.
I'm not using any com components. It's all managed code.
Good.

Do you know of any samples that show how to use those Performance counter
classes?


here the documentation for monitoring memory usage:
http://msdn.microsoft.com/library/de...rprocesses.asp

here is the start of the documentation on system monitoring components
in general...

http://msdn.microsoft.com/library/de...dsonserver.asp

--
Tom Shelton [MVP]
OS Name: Microsoft Windows XP Professional
OS Version: 5.1.2600 Service Pack 1 Build 2600
System Up Time: 2 Days, 12 Hours, 21 Minutes, 34 Seconds
Nov 20 '05 #4

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

Similar topics

9
by: fudmore | last post by:
Hello Everybody. I have a Segmentation fault problem. The code section at the bottom keeps throwing a Segmentation fault when it enters the IF block for the second time. const int...
2
by: aaronk321 | last post by:
Look below.. I'm baffled - what is going on? db2 => select tablespace_name from table(snapshot_tbs('epmdev01', -1)) as snapshot_tbs Do you want to execute the above command ? (y/n) y ...
9
by: Microsoft News Server | last post by:
Hi, I am currently having a problem with random, intermittent lock ups in my ASP.net application on our production server (99% CPU usage by 3 threads, indefinately). I currently use IIS Debug...
4
by: Sean Shanny | last post by:
To all, Running into an out of memory error on our data warehouse server. This occurs only with our data from the 'September' section of a large fact table. The exact same query running over...
4
by: lawrence k | last post by:
I've a jpeg image that is 514k, which doesn't strike me as very large. Yet I'm running out of error when I try to resize it: Fatal error: Allowed memory size of 20971520 bytes exhausted (tried to...
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...
13
by: SAL | last post by:
Okay, don't bash me to hard for my design on this app, it's my first web app and it's in production. My basic design is using Datatables created via the designer with a business logic class in...
2
by: karinmorena | last post by:
I'm having 4 errors, I'm very new at this and I would appreciate your input. The error I get is: Week5MortgageGUI.java:151:cannot find symbol symbol: method allInterest(double,double,double)...
1
by: kamcap | last post by:
I have referenced a COM dll (unmanagged code) in a C# console application and this DLL is referenced in C# program using Interop facility in .NET. This dll actually a dataset/table which is written...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.