hi,
i have a garbage collection problem. i have an application writen by
vb.net, i am opening a form and in this form there is a big query. when i
open the form, it takes 80 mb memory because of the data table. when i closed
the form it is already taking 80 mb memory. where is garbage collection? i am
waiting 30 minutes but memory usage is not decreasing. what must i do?
thanks,
Ömer KUL 14 1510
Have a look at http://getdotnetco.web101.discountas...%20Mystery.htm
"Ömer KUL" <me****@discussions.microsoft.com> wrote in message
news:AD**********************************@microsof t.com... hi, i have a garbage collection problem. i have an application writen by vb.net, i am opening a form and in this form there is a big query. when i open the form, it takes 80 mb memory because of the data table. when i closed the form it is already taking 80 mb memory. where is garbage collection? i am waiting 30 minutes but memory usage is not decreasing. what must i do? thanks, Ömer KUL
hi Hederman,
i have read the article. thank you very much for your help. the article is
very helpful but it is not answering my question. i am opening a form and
memory usage is increasing(80 mb), after that i am closing it but memory
usage is not decreasing. whenever i open the form memory usage is increasing
80 mb and going on so... that is the problem...
thanks
Ömer KUL
"Sean Hederman": Have a look at http://getdotnetco.web101.discountas...%20Mystery.htm
"Ömer KUL" <me****@discussions.microsoft.com> wrote in message news:AD**********************************@microsof t.com... hi, i have a garbage collection problem. i have an application writen by vb.net, i am opening a form and in this form there is a big query. when i open the form, it takes 80 mb memory because of the data table. when i closed the form it is already taking 80 mb memory. where is garbage collection? i am waiting 30 minutes but memory usage is not decreasing. what must i do? thanks, Ömer KUL
If you're not holding any references to your datasets then the CLR will free
the memory when it needs to, not on some schedule. So the point would be to
ensure that the references to your datasets are being cleared.
"Ömer KUL" <me****@discussions.microsoft.com> wrote in message
news:05**********************************@microsof t.com... hi Hederman, i have read the article. thank you very much for your help. the article is very helpful but it is not answering my question. i am opening a form and memory usage is increasing(80 mb), after that i am closing it but memory usage is not decreasing. whenever i open the form memory usage is increasing 80 mb and going on so... that is the problem... thanks Ömer KUL
"Sean Hederman":
Have a look at http://getdotnetco.web101.discountas...%20Mystery.htm
"Ömer KUL" <me****@discussions.microsoft.com> wrote in message news:AD**********************************@microsof t.com... > hi, > i have a garbage collection problem. i have an application writen by > vb.net, i am opening a form and in this form there is a big query. when > i > open the form, it takes 80 mb memory because of the data table. when i > closed > the form it is already taking 80 mb memory. where is garbage > collection? i > am > waiting 30 minutes but memory usage is not decreasing. what must i do? > thanks, > Ömer KUL
Task Manager doesn't always show memory usage correctly. To see this follow
these steps:
- Create a new Windows Forms application
- Run it
- Check memory usage in Task Manager
- My computer shows 15,554 K
- Minimize the app
- Check memory usage in Task Manager
- My computer shows 864 K
- Restore the app
- Check memory usage in Task Manager
- My computer shows 1,784 K
Try minimizing the app after you close the form and see if the memory usage
changes.
--
Rob Windsor [MVP-VB]
G6 Consulting
Toronto, Canada http://msmvps.com/windsor/
"Ömer KUL" <me****@discussions.microsoft.com> wrote in message
news:05**********************************@microsof t.com... hi Hederman, i have read the article. thank you very much for your help. the article is very helpful but it is not answering my question. i am opening a form and memory usage is increasing(80 mb), after that i am closing it but memory usage is not decreasing. whenever i open the form memory usage is increasing 80 mb and going on so... that is the problem... thanks Ömer KUL
"Sean Hederman":
Have a look at http://getdotnetco.web101.discountas...%20Mystery.htm
"Ömer KUL" <me****@discussions.microsoft.com> wrote in message news:AD**********************************@microsof t.com... > hi, > i have a garbage collection problem. i have an application writen by > vb.net, i am opening a form and in this form there is a big query. when > i > open the form, it takes 80 mb memory because of the data table. when i > closed > the form it is already taking 80 mb memory. where is garbage > collection? i > am > waiting 30 minutes but memory usage is not decreasing. what must i do? > thanks, > Ömer KUL
"Rob Windsor [MVP]" <ro*****************@gmail.com> wrote in message
news:OK**************@TK2MSFTNGP09.phx.gbl... Task Manager doesn't always show memory usage correctly. To see this follow these steps:
- Create a new Windows Forms application - Run it - Check memory usage in Task Manager - My computer shows 15,554 K - Minimize the app - Check memory usage in Task Manager - My computer shows 864 K - Restore the app - Check memory usage in Task Manager - My computer shows 1,784 K
Try minimizing the app after you close the form and see if the memory usage changes.
And what makes you think this isn't correct here?
The OS automatically reduces the workingset of a windows application
(any)when minimizing, this has been done since NT4 was introduced years ago.
Taskman takes it's values from the preformance counters, do you mean that
these aren't correct?
Willy.
"Ömer KUL" <me****@discussions.microsoft.com> wrote in message
news:AD**********************************@microsof t.com... hi, i have a garbage collection problem. i have an application writen by vb.net, i am opening a form and in this form there is a big query. when i open the form, it takes 80 mb memory because of the data table. when i closed the form it is already taking 80 mb memory. where is garbage collection? i am waiting 30 minutes but memory usage is not decreasing. what must i do? thanks, Ömer KUL
When there is no garbage, there is nothing to collect, that's how the GC
works, so in your case there is no garbage because you are still holding
references to your Data Tables. Please post your code if you want to get any
more help.
Willy.
Hi Willy,
i am closing the form that increases the memory usage. are not the all
variables and controls on the form disposed? after now, does not the GC
collect them?
i can not send you all code, because it is an ERP packet and it is 50 mb
when zipped. i can send you code samples if you want.
thanks
Ömer KUL
"Willy Denoyette [MVP]": "Ömer KUL" <me****@discussions.microsoft.com> wrote in message news:AD**********************************@microsof t.com... hi, i have a garbage collection problem. i have an application writen by vb.net, i am opening a form and in this form there is a big query. when i open the form, it takes 80 mb memory because of the data table. when i closed the form it is already taking 80 mb memory. where is garbage collection? i am waiting 30 minutes but memory usage is not decreasing. what must i do? thanks, Ömer KUL
When there is no garbage, there is nothing to collect, that's how the GC works, so in your case there is no garbage because you are still holding references to your Data Tables. Please post your code if you want to get any more help.
Willy.
Ömer KUL wrote: i have a garbage collection problem. i have an application writen by vb.net, i am opening a form and in this form there is a big query. when i open the form, it takes 80 mb memory because of the data table. when i closed the form it is already taking 80 mb memory. where is garbage collection? i am waiting 30 minutes but memory usage is not decreasing. what must i do?
Merely waiting won't do anything - garbage collection is triggered by
allocations, not a timer.
-- www.midnightbeach.com
"Ömer KUL" <me****@discussions.microsoft.com> wrote in message
news:AD**********************************@microsof t.com... Hi Willy, i am closing the form that increases the memory usage. are not the all variables and controls on the form disposed? after now, does not the GC collect them?
No, only those variables that are only referenced on the form will be
available for GC, and just because they're available doesn't mean they will
be GC'd.
i can not send you all code, because it is an ERP packet and it is 50 mb when zipped. i can send you code samples if you want. thanks Ömer KUL
"Willy Denoyette [MVP]":
"Ömer KUL" <me****@discussions.microsoft.com> wrote in message news:AD**********************************@microsof t.com... > hi, > i have a garbage collection problem. i have an application writen by > vb.net, i am opening a form and in this form there is a big query. when > i > open the form, it takes 80 mb memory because of the data table. when i > closed > the form it is already taking 80 mb memory. where is garbage > collection? i > am > waiting 30 minutes but memory usage is not decreasing. what must i do? > thanks, > Ã-mer KUL
When there is no garbage, there is nothing to collect, that's how the GC works, so in your case there is no garbage because you are still holding references to your Data Tables. Please post your code if you want to get any more help.
Willy.
"Sean Hederman" <em*******@codingsanity.blogspot.com> wrote in message
news:d6**********@ctb-nnrp2.saix.net... No, only those variables that are only referenced on the form will be available for GC, and just because they're available doesn't mean they will be GC'd.
right away
Hi Omer, i can not send you all code, because it is an ERP packet and it is 50 mb when zipped. i can send you code samples if you want. thanks
Typically we ask that you post only the code snippets that you believe are
causing your problem or which form a basis for you to believe that the code
"should" work. In this case, it would be helpful if you would post the
calls that fetch the data, and enough information for us to know where the
references are stored for the data (on the stack or on the heap). Also, it
would be helpful if you would post the code that occurs when you opened and
closed the form.
Notes:
80Mb is a very large amount of data. Is there any way you can reduce the
amount of data that has to be returned by being more explicit in your
queries? There is no reasonable way for me to believe that you are actually
presenting 80Mb worth of data to the user... so clearly you are returning
some data that you don't need.
--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster http://blogs.msdn.com/nickmalik
Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"Ömer KUL" <me****@discussions.microsoft.com> wrote in message
news:AD**********************************@microsof t.com... Hi Willy, i am closing the form that increases the memory usage. are not the all variables and controls on the form disposed? after now, does not the GC collect them? i can not send you all code, because it is an ERP packet and it is 50 mb when zipped. i can send you code samples if you want. thanks Ömer KUL
"Willy Denoyette [MVP]":
"Ömer KUL" <me****@discussions.microsoft.com> wrote in message news:AD**********************************@microsof t.com... > hi, > i have a garbage collection problem. i have an application writen by > vb.net, i am opening a form and in this form there is a big query. when > i > open the form, it takes 80 mb memory because of the data table. when i > closed > the form it is already taking 80 mb memory. where is garbage > collection? i > am > waiting 30 minutes but memory usage is not decreasing. what must i do? > thanks, > Ã-mer KUL
When there is no garbage, there is nothing to collect, that's how the GC works, so in your case there is no garbage because you are still holding references to your Data Tables. Please post your code if you want to get any more help.
Willy.
Omar,
I found the replys from Willy and Sean very clear. Now that there is a new
message added, I will try to explain their messages something more.
When you have done in by instance (I see not the code you use therefore in
VBNet)
In form1
Private myDatatable as Datatable
dim frm as new Form2
frm.datatablefrm2 = myDatatable
frm Show
And you have in your Form2
datatablefrm2 = new datatable.
Than the memory used by that datatable will released by the GC as soon as
there are no references any more in that datatable and set to nothing in
form1 (or that both forms are closed)
It is a strange way of coding by the way, however this can give the effect
you are talking about.
I hope this gives an idea
Cor
hi Willy,
i am using a variable that declared as datatable. i get data from query and
set the datatable. after i used the datatable i dispose it but the memory
usage is not decreasing. the datatable gets about 80 mb memory...
if you give me your e-mail i can send your code part.
thanks for your helps.
Ömer KUL
"Willy Denoyette [MVP]": "Ömer KUL" <me****@discussions.microsoft.com> wrote in message news:AD**********************************@microsof t.com... hi, i have a garbage collection problem. i have an application writen by vb.net, i am opening a form and in this form there is a big query. when i open the form, it takes 80 mb memory because of the data table. when i closed the form it is already taking 80 mb memory. where is garbage collection? i am waiting 30 minutes but memory usage is not decreasing. what must i do? thanks, Ömer KUL
When there is no garbage, there is nothing to collect, that's how the GC works, so in your case there is no garbage because you are still holding references to your Data Tables. Please post your code if you want to get any more help.
Willy.
Omer,
Disposing a datatable does almost nothing, however using clear can help you
with the datatable and with the dataset. http://msdn.microsoft.com/library/de...cleartopic.asp
When that does not help, you can as quick fix as well try the
dataset.Tables[x].Remove;
in the closing method of that form.
I hope this helps,
Cor This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Bob |
last post by:
Are there any known applications out there used to test the performance of the .NET garbage collector over a long period of time? Basically I need an application that creates objects, uses them, and...
|
by: Ganesh |
last post by:
Is there a utility by microsoft (or anyone) to force garbage collection in a
process without have access to the process code.
regards
Ganesh
|
by: Rick |
last post by:
Hi,
My question is.. if Lisp, a 40 year old language supports garbage
collection, why didn't the authors of C++ choose garbage collection for
this language? Are there fundamental reasons behind...
|
by: Ville Voipio |
last post by:
I would need to make some high-reliability software
running on Linux in an embedded system. Performance
(or lack of it) is not an issue, reliability is.
The piece of software is rather simple,...
|
by: Bob lazarchik |
last post by:
Hello:
We are considering developing a time critical system in C#. Our tool used in
Semiconductor production and we need to be able to take meaurements at
precise 10.0 ms intervals( 1000...
|
by: mike2036 |
last post by:
For some reason it appears that garbage collection is releasing an object
that I'm still using. The object is declared in a module and instantiated
within a class that is in turn instantiated by...
|
by: Goalie_Ca |
last post by:
I have been reading (or at least googling) about the potential addition
of optional garbage collection to C++0x. There are numerous myths and
whatnot with very little detailed information.
Will...
|
by: Johnny E. Jensen |
last post by:
Hellow
I'am not sure what to think about the Garbage Collector.
I have a Class OutlookObject, It have two private variables.
Private Microsoft.Office.Interop.Outlook.Application _Application =...
|
by: Lloyd Bonafide |
last post by:
I followed a link to James Kanze's web site in another thread and was
surprised to read this comment by a link to a GC:
"I can't imagine writing C++ without it"
How many of you c.l.c++'ers use...
|
by: pushpakulkar |
last post by:
Hi all,
Is garbage collection possible in C++. It doesn't come as part of
language support. Is there any specific reason for the same due to the
way the language is designed. Or it is...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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: 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: 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: 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: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
| |