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

Memory doesn't release (from collections)

Hello, I am using several queue collections to store some data (about 20,000
entries split across 2 collections). When I view the process in the Windows
task manager I can see the memory increasing when the collections start to
fill. However, when I stop the thread and clear the queues (and set the
instance to nothing) the memory does not drop at all.

Am I doing something wrong?

Thanks!!
Nov 21 '05 #1
11 1191
Just because an object is eligible for garbage collection, doesn't mean it
gets garbage collected right away.

When the garbage collector decides to run, then anything eligible will get
collected. Until then it will sit there taking up memory.

"Brian Mitchell" <Ma********@hotmail.com> wrote in message
news:us**************@TK2MSFTNGP12.phx.gbl...
Hello, I am using several queue collections to store some data (about 20,000 entries split across 2 collections). When I view the process in the Windows task manager I can see the memory increasing when the collections start to
fill. However, when I stop the thread and clear the queues (and set the
instance to nothing) the memory does not drop at all.

Am I doing something wrong?

Thanks!!

Nov 21 '05 #2
is there a way to "force" garbage collection?

"Marina" <so*****@nospam.com> wrote in message
news:uC**************@TK2MSFTNGP09.phx.gbl...
Just because an object is eligible for garbage collection, doesn't mean it
gets garbage collected right away.

When the garbage collector decides to run, then anything eligible will get
collected. Until then it will sit there taking up memory.

"Brian Mitchell" <Ma********@hotmail.com> wrote in message
news:us**************@TK2MSFTNGP12.phx.gbl...
Hello, I am using several queue collections to store some data (about

20,000
entries split across 2 collections). When I view the process in the

Windows
task manager I can see the memory increasing when the collections start to fill. However, when I stop the thread and clear the queues (and set the
instance to nothing) the memory does not drop at all.

Am I doing something wrong?

Thanks!!


Nov 21 '05 #3
Yes, you can use gc.collect but no matter I let the program sit for 2 hours
and it still didn't free the memory. I even set a breakpoint to make sure
the class was set to nothing.

"Dave" <dave(delete_this)@miraclecatDELETETHISTOO.com> wrote in message
news:u8**************@TK2MSFTNGP10.phx.gbl...
is there a way to "force" garbage collection?

"Marina" <so*****@nospam.com> wrote in message
news:uC**************@TK2MSFTNGP09.phx.gbl...
Just because an object is eligible for garbage collection, doesn't mean
it
gets garbage collected right away.

When the garbage collector decides to run, then anything eligible will
get
collected. Until then it will sit there taking up memory.

"Brian Mitchell" <Ma********@hotmail.com> wrote in message
news:us**************@TK2MSFTNGP12.phx.gbl...
> Hello, I am using several queue collections to store some data (about

20,000
> entries split across 2 collections). When I view the process in the

Windows
> task manager I can see the memory increasing when the collections start to > fill. However, when I stop the thread and clear the queues (and set the
> instance to nothing) the memory does not drop at all.
>
> Am I doing something wrong?
>
> Thanks!!
>
>



Nov 21 '05 #4
is there a way to "force" garbage collection?

"Marina" <so*****@nospam.com> wrote in message
news:uC**************@TK2MSFTNGP09.phx.gbl...
Just because an object is eligible for garbage collection, doesn't mean it
gets garbage collected right away.

When the garbage collector decides to run, then anything eligible will get
collected. Until then it will sit there taking up memory.

"Brian Mitchell" <Ma********@hotmail.com> wrote in message
news:us**************@TK2MSFTNGP12.phx.gbl...
Hello, I am using several queue collections to store some data (about

20,000
entries split across 2 collections). When I view the process in the

Windows
task manager I can see the memory increasing when the collections start to fill. However, when I stop the thread and clear the queues (and set the
instance to nothing) the memory does not drop at all.

Am I doing something wrong?

Thanks!!


Nov 21 '05 #5
Yes, you can use gc.collect but no matter I let the program sit for 2 hours
and it still didn't free the memory. I even set a breakpoint to make sure
the class was set to nothing.

"Dave" <dave(delete_this)@miraclecatDELETETHISTOO.com> wrote in message
news:u8**************@TK2MSFTNGP10.phx.gbl...
is there a way to "force" garbage collection?

"Marina" <so*****@nospam.com> wrote in message
news:uC**************@TK2MSFTNGP09.phx.gbl...
Just because an object is eligible for garbage collection, doesn't mean
it
gets garbage collected right away.

When the garbage collector decides to run, then anything eligible will
get
collected. Until then it will sit there taking up memory.

"Brian Mitchell" <Ma********@hotmail.com> wrote in message
news:us**************@TK2MSFTNGP12.phx.gbl...
> Hello, I am using several queue collections to store some data (about

20,000
> entries split across 2 collections). When I view the process in the

Windows
> task manager I can see the memory increasing when the collections start to > fill. However, when I stop the thread and clear the queues (and set the
> instance to nothing) the memory does not drop at all.
>
> Am I doing something wrong?
>
> Thanks!!
>
>



Nov 21 '05 #6
I believe one of the criteria for the Garbage Collector to run is the need
for memory space. If you have plenty of memory space, it may be that the
Garbage Collector doesn't think it needs to run. You might try running
another application that take a lot of memory to see if it releases some
memory.

"Brian Mitchell" wrote:
Yes, you can use gc.collect but no matter I let the program sit for 2 hours
and it still didn't free the memory. I even set a breakpoint to make sure
the class was set to nothing.

"Dave" <dave(delete_this)@miraclecatDELETETHISTOO.com> wrote in message
news:u8**************@TK2MSFTNGP10.phx.gbl...
is there a way to "force" garbage collection?

"Marina" <so*****@nospam.com> wrote in message
news:uC**************@TK2MSFTNGP09.phx.gbl...
Just because an object is eligible for garbage collection, doesn't mean
it
gets garbage collected right away.

When the garbage collector decides to run, then anything eligible will
get
collected. Until then it will sit there taking up memory.

"Brian Mitchell" <Ma********@hotmail.com> wrote in message
news:us**************@TK2MSFTNGP12.phx.gbl...
> Hello, I am using several queue collections to store some data (about
20,000
> entries split across 2 collections). When I view the process in the
Windows
> task manager I can see the memory increasing when the collections start

to
> fill. However, when I stop the thread and clear the queues (and set the
> instance to nothing) the memory does not drop at all.
>
> Am I doing something wrong?
>
> Thanks!!
>
>



Nov 21 '05 #7
Dave,

There are two criteria to let a object get removed by the garbage collector.
1 it has itself no reference anymore
2 there is not any reference anymore to it

Private myarraylist1 as new arraylist
sub mysub
dim myarraylist2 as new arraylist
myarraylist.add(myarraylist2)
end sub

Although mysub goes out of scope and myarraylist2 is automaticly nothing,
will it not be removed as long as myarralist1 exist.

I hope this helps?

Cor
Nov 21 '05 #8
I believe one of the criteria for the Garbage Collector to run is the need
for memory space. If you have plenty of memory space, it may be that the
Garbage Collector doesn't think it needs to run. You might try running
another application that take a lot of memory to see if it releases some
memory.

"Brian Mitchell" wrote:
Yes, you can use gc.collect but no matter I let the program sit for 2 hours
and it still didn't free the memory. I even set a breakpoint to make sure
the class was set to nothing.

"Dave" <dave(delete_this)@miraclecatDELETETHISTOO.com> wrote in message
news:u8**************@TK2MSFTNGP10.phx.gbl...
is there a way to "force" garbage collection?

"Marina" <so*****@nospam.com> wrote in message
news:uC**************@TK2MSFTNGP09.phx.gbl...
Just because an object is eligible for garbage collection, doesn't mean
it
gets garbage collected right away.

When the garbage collector decides to run, then anything eligible will
get
collected. Until then it will sit there taking up memory.

"Brian Mitchell" <Ma********@hotmail.com> wrote in message
news:us**************@TK2MSFTNGP12.phx.gbl...
> Hello, I am using several queue collections to store some data (about
20,000
> entries split across 2 collections). When I view the process in the
Windows
> task manager I can see the memory increasing when the collections start

to
> fill. However, when I stop the thread and clear the queues (and set the
> instance to nothing) the memory does not drop at all.
>
> Am I doing something wrong?
>
> Thanks!!
>
>



Nov 21 '05 #9
> Dave,
Sorry should have been Brian,
Nov 21 '05 #10
Dave,

There are two criteria to let a object get removed by the garbage collector.
1 it has itself no reference anymore
2 there is not any reference anymore to it

Private myarraylist1 as new arraylist
sub mysub
dim myarraylist2 as new arraylist
myarraylist.add(myarraylist2)
end sub

Although mysub goes out of scope and myarraylist2 is automaticly nothing,
will it not be removed as long as myarralist1 exist.

I hope this helps?

Cor
Nov 21 '05 #11
> Dave,
Sorry should have been Brian,
Nov 21 '05 #12

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

Similar topics

4
by: Franklin Lee | last post by:
Hi All, I use new to allocate some memory,even I doesn't use delete to release them. When my Application exit, OS will release them. Am I right? If I'm right, how about Thread especally on...
9
by: Mike P | last post by:
I know everything about reference counting and making sure you don't have large objects lying around. I have also profiled my app with multiple tools. I know about the fact GC collects memory but...
7
by: Lars-Erik Aabech | last post by:
Hi! I've got problems with serializing my collections of business objects. The objects themselves serialize fine, but the collections fail. I've got the following structure: Base collection...
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...
30
by: MAG1301 | last post by:
I've detected memory leaks in our huge .NET 1.1 C# application but couldn't localize them directly. So I've reduced the code to the following console application: using System; using System.IO;...
7
by: Malcolm Klotz | last post by:
Hello, I have created a Windows Service application in VB.Net 2005. The service is pretty basic, it uses the System.Timers.Timer class to poll a database that checks for jobs to perform. Upon...
8
by: Lauren the Ravishing | last post by:
Hi, In ASP, is it absolutely necessary to set an object to Nothing after being used? set myObj = server.createObject("myDLL.myClass") call myObj.useClass set myObj = Nothing <--- can I...
0
by: xievvv | last post by:
We are experiencing a memory leak in one of our applications. It is a web-based reporting system that produces large (> 500mb) PDF reports. It takes approx 4 hours to run the largest of these reports...
15
by: Frank Rizzo | last post by:
I have an app ( referenced in thread news://msnews.microsoft.com:119/OPTBaFDlHHA.3280@TK2MSFTNGP05.phx.gbl ) that won't give up memory. Several people stated that GC won't clean up memory unless...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...

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.