473,396 Members | 2,154 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,396 software developers and data experts.

Server out of memory errors - will erasing arrays make a difference?

We're getting "ERROR (0x8007000E) Not enough storage is available to
complete this operation" errors on a fairly large, busy ASP/SQL Server web
site. The error is being thrown on a line calling oRs.GetRows() on one of
our busiest pages. The array returned from the GetRows() call will be
'cleaned up' when the page goes out of scope, but I wonder if we should be
calling Erase specifically after the last usage to explicitly free allocated
memory. Is there any actual benefit doing this cleanup explicitly? I've
always throught that ASP's memory deallocation was a bit spotty - can anyone
comment.

Thanks.
Nov 28 '05 #1
5 4631
Tim
....asp tidying up after itself?

....pages going "out of scope"

your not from an M$ background are you!

tidy up everything. leave nothing open.
..close
set=nothing
everything you can!!!

there is no garbage collection in ASP.

pages don't go out of scope when they are closed. the user may close their
browser, but the server doesn't know this.

hope this gives u some clues.

"Alan Howard" <Xa***********@Xparadise.net.nzX> wrote in message
news:uN**************@TK2MSFTNGP09.phx.gbl...
We're getting "ERROR (0x8007000E) Not enough storage is available to
complete this operation" errors on a fairly large, busy ASP/SQL Server web
site. The error is being thrown on a line calling oRs.GetRows() on one of
our busiest pages. The array returned from the GetRows() call will be
'cleaned up' when the page goes out of scope, but I wonder if we should be
calling Erase specifically after the last usage to explicitly free
allocated
memory. Is there any actual benefit doing this cleanup explicitly? I've
always throught that ASP's memory deallocation was a bit spotty - can
anyone
comment.

Thanks.

Nov 29 '05 #2
I think we all know what best practices we should be following - I guess I'm
wondering if anyone has run up against this sort of situation in the past
and knows whether explicitly erasing arrays makes a difference. I'm not
talking about ADO objects.

"Tim" <th**@ltons.freeserve.co.uk> wrote in message
news:dm**********@news6.svr.pol.co.uk...
...asp tidying up after itself?

...pages going "out of scope"

your not from an M$ background are you!

tidy up everything. leave nothing open.
.close
set=nothing
everything you can!!!

there is no garbage collection in ASP.

pages don't go out of scope when they are closed. the user may close their
browser, but the server doesn't know this.

hope this gives u some clues.

"Alan Howard" <Xa***********@Xparadise.net.nzX> wrote in message
news:uN**************@TK2MSFTNGP09.phx.gbl...
We're getting "ERROR (0x8007000E) Not enough storage is available to
complete this operation" errors on a fairly large, busy ASP/SQL Server web site. The error is being thrown on a line calling oRs.GetRows() on one of our busiest pages. The array returned from the GetRows() call will be
'cleaned up' when the page goes out of scope, but I wonder if we should be calling Erase specifically after the last usage to explicitly free
allocated
memory. Is there any actual benefit doing this cleanup explicitly? I've
always throught that ASP's memory deallocation was a bit spotty - can
anyone
comment.

Thanks.


Nov 29 '05 #3
Allocated memory and created objects are supposed to be deallocated and
destroyed when the page script completes. There have been problems in the
past with some of the ADO objects not being destroyed and causing memory
leaks (other com objects may have similar problems) but I don't know of any
problems with arrays.

Make sure that you are closing all ADO objects and setting to all objects to
Nothing as soon as you are done with them. It wouldn't hurt to erase your
arrays but I don't think you would see any impact from that unless your
arrays are very large and a there is a significant delay between the time
that you no longer need the array data and when the page completes.

Just how big are the arrays? Could you process the data in smaller chunks?

--
--Mark Schupp
"Alan Howard" <Xa***********@Xparadise.net.nzX> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
I think we all know what best practices we should be following - I guess
I'm
wondering if anyone has run up against this sort of situation in the past
and knows whether explicitly erasing arrays makes a difference. I'm not
talking about ADO objects.

"Tim" <th**@ltons.freeserve.co.uk> wrote in message
news:dm**********@news6.svr.pol.co.uk...
...asp tidying up after itself?

...pages going "out of scope"

your not from an M$ background are you!

tidy up everything. leave nothing open.
.close
set=nothing
everything you can!!!

there is no garbage collection in ASP.

pages don't go out of scope when they are closed. the user may close
their
browser, but the server doesn't know this.

hope this gives u some clues.

"Alan Howard" <Xa***********@Xparadise.net.nzX> wrote in message
news:uN**************@TK2MSFTNGP09.phx.gbl...
> We're getting "ERROR (0x8007000E) Not enough storage is available to
> complete this operation" errors on a fairly large, busy ASP/SQL Server web > site. The error is being thrown on a line calling oRs.GetRows() on one of > our busiest pages. The array returned from the GetRows() call will be
> 'cleaned up' when the page goes out of scope, but I wonder if we should be > calling Erase specifically after the last usage to explicitly free
> allocated
> memory. Is there any actual benefit doing this cleanup explicitly? I've
> always throught that ASP's memory deallocation was a bit spotty - can
> anyone
> comment.
>
> Thanks.
>
>



Nov 29 '05 #4
Tim wrote:
...asp tidying up after itself?

...pages going "out of scope"

your not from an M$ background are you!
What difference does that make?

tidy up everything. leave nothing open.
.close
set=nothing
everything you can!!!
Sort of. But see:
http://blogs.msdn.com/ericlippert/ar...28/122259.aspx
and
http://tinyurl.com/3ajhk
there is no garbage collection in ASP.
??!?
From "ASP Internals" by Jon Flanders:
"IServer::CreateObject keeps an internal list of objects it creates. When
the script execution ends, the Server object decrements the reference count
on the interfaces in this list. This doesn't mean that we shouldn't
explicitly garbage-collect when writing ASP, but if we forget, ASP will do
it for us."
There may be bugs in some COM objects that prevent the garbage collection
from working, but there certainly is GC in ASP, as well as in the script
engine.
pages don't go out of scope when they are closed.
LOL
Pages DO go out of scope when the response ends. Everything that happens at
the client is outside of the scope of ASP.
the user may close
their browser, but the server doesn't know this.


Umm, that's irrelevant. The server-side script went out of scope when the
response ended. You may be thinking of the Session ....

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Nov 29 '05 #5
Alan Howard wrote:
We're getting "ERROR (0x8007000E) Not enough storage is available to
complete this operation" errors on a fairly large, busy ASP/SQL
Server web site. The error is being thrown on a line calling
oRs.GetRows() on one of our busiest pages. The array returned from
the GetRows() call will be 'cleaned up' when the page goes out of
scope, but I wonder if we should be calling Erase specifically after
the last usage to explicitly free allocated memory. Is there any
actual benefit doing this cleanup explicitly? I've always throught
that ASP's memory deallocation was a bit spotty - can anyone comment.

Thanks.

I've never experienced or heard about a memory leak caused by failure to
erase arrays. I do remember back in my VB days reading advice to always
erase them, so for sizable arrays I still tend to follow that advice. I know
.... not much help.

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Nov 29 '05 #6

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

Similar topics

31
by: lawrence | last post by:
I'm not sure how this is normally done, on a large site, perhaps one running Phorum. Occassionally a thread will have hundreds of entries, perhaps a meg or two worth of data. You won't necessarily...
8
by: Rodd Snook | last post by:
I have an application which makes extensive use of the Scripting.Dictionary object. I'm not doing anything silly like putting them outside the page scope -- just creating quite a few of them and...
4
by: Lost Bits | last post by:
Hello there C++ pros.. Well, I have recently redesigned an already existing piece of code that someone else designed - its just a search algorithm they developed, and has to perfomr millions of...
6
by: Daniel Walzenbach | last post by:
Hi, I have a web application which sometimes throws an “out of memory” exception. To get an idea what happens I traced some values using performance monitor and got the following values (for...
38
by: Peteroid | last post by:
I looked at the addresses in an 'array<>' during debug and noticed that the addresses were contiguous. Is this guaranteed, or just something it does if it can? PS = VS C++.NET 2005 Express...
18
by: MajorSetback | last post by:
I am using the Redhat version of Linux and GNU C++. It is not clear to me whether this is a Linux issue or a C++ issue. I do not have this problem running the same program on Windows but...
12
by: Cordell Lawrence \(News Group\) | last post by:
There an ongoing discussion between a colleague and myself about the usefulness of the IDisposable pattern beyond the reclamation of unmanaged resources. The discussion is somewhat lengthy so I...
10
by: deciacco | last post by:
I'm writing a command line utility to move some files. I'm dealing with thousands of files and I was wondering if anyone had any suggestions. This is what I have currently: $arrayVirtualFile =...
27
by: George2 | last post by:
Hello everyone, Should I delete memory pointed by pointer a if there is bad_alloc when allocating memory in memory pointed by pointer b? I am not sure whether there will be memory leak if I do...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...

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.