473,513 Members | 2,605 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Freeing Virtual Memory on app close

I was wondering how to manage Virtual Memory usage within a VB app. I
have a form with a trend on it that takes ~40MB of virtual memory when
it is loaded (depending on the amount of data being plotted). When
the form is closed, the memory is still being used (even though I call
the .dispose method of the chart object). Every time I re-open the
same form, there goes 40MB more virtual memory. This memory is not
released until the application terminates.

So, my question: how do I explicitly release the memory being used by
this form?

Thanks!

Apr 10 '07 #1
3 1979
Something is not being disposed. One way to figure out what is to step
through the code one line at a time and see exactly what is causing the
memory allocation, and what is not being disposed.

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"jtertin" <jt*****@gmail.comwrote in message
news:11*********************@b75g2000hsg.googlegro ups.com...
>I was wondering how to manage Virtual Memory usage within a VB app. I
have a form with a trend on it that takes ~40MB of virtual memory when
it is loaded (depending on the amount of data being plotted). When
the form is closed, the memory is still being used (even though I call
the .dispose method of the chart object). Every time I re-open the
same form, there goes 40MB more virtual memory. This memory is not
released until the application terminates.

So, my question: how do I explicitly release the memory being used by
this form?

Thanks!

Apr 10 '07 #2
There are only two objects that I should have to worry about disposing
- the chart object on the form, and the form itself. The form itself
should (correct me if I am wrong) be disposed when it is closed. I
have the [ChartObject].Dispose() method being called on the form's
closing event. Is this correct? Something is still awry as it still
does not free up VM usage when the form is closed. Any suggestions?

Apr 10 '07 #3
First, you will have to dispose the Form. More than that I can't say, as I'm
not sure how you're invoking the Form, but you will certainly have to
dispose it unless you plan to re-use it.

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"jtertin" <jt*****@gmail.comwrote in message
news:11**********************@w1g2000hsg.googlegro ups.com...
There are only two objects that I should have to worry about disposing
- the chart object on the form, and the form itself. The form itself
should (correct me if I am wrong) be disposed when it is closed. I
have the [ChartObject].Dispose() method being called on the form's
closing event. Is this correct? Something is still awry as it still
does not free up VM usage when the form is closed. Any suggestions?

Apr 10 '07 #4

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

Similar topics

7
1665
by: Curley Q. | last post by:
for(;;) { c = a * b; c %= 100000; printf("%9d", c); d = int2str(c); left = midstr(d, 0, 3); right = midstr(d, strlen(d)-3, 3); free(d); a = atoi(left);
10
2063
by: dmanhr | last post by:
Hi! I'd like to free-up - destroy (myself not GC) object n (Node) with implementing Dispose(). I have linked list: class Node{ CNode nextNode; object data;
10
3783
by: VM | last post by:
How can I limit the use of the PC's virtual memory? I'm running a process that basically takes a txt file and loads it to a datatable. The problem is that the file is over 400,000 lines long (77...
6
2747
by: Fernando Cacciola | last post by:
Help me out here please: While watching Brad Abraham's MSDN TV talk about the Dispose pattern, refering to: public virtual void Dispose ( bool disposing ) { if ( disposing ) { <-- WHAT...
6
2713
by: copx | last post by:
Can you / are you supposed to free() string literals which are no longer needed? In my case I've menu construction code that looks like this: menu_items = list_new(); list_add(menu_items,...
4
36512
by: Atul Sureka | last post by:
Hi, I want to free the object memory in C# - like we do using 'delete' keyword in C++. Lets say I have an object of some class and I want to explicitly free the memory. C# do not have any free...
0
1575
by: George2 | last post by:
Hello everyone, From the definition of working set, it is a subset of virtual pages resident in physical memory -- from book Windows Internals. It means working set could not be larger than...
66
3635
by: karthikbalaguru | last post by:
Hi, Will 'free' return the memory Immediately to the OS ? Thx in advans, Karthik Balaguru
11
1981
by: vivek | last post by:
Hello, I have a pointer to a main structure which again consists of structures, enums, char, int, float and again complex structures. When i free all the contents of the main structure, it...
0
7260
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
7384
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,...
1
7099
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
7525
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...
0
5685
agi2029
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,...
0
3233
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3222
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
799
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
456
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.