Connecting Tech Pros Worldwide Forums | Help | Site Map

memory usage

tomvr
Guest
 
Posts: n/a
#1: Jul 21 '05
Hello

I have noticed some 'weird' memory usage in a vb.net windows app
The situation is as follows
I have an app (heavy on images) with 2 forms
(actually there are more forms and on starting the app I load some things into memory for global use of the app but I'll use only 2 starting forms to explain the situation)

situation 1
start app with form 1 (72mb memory usage), show form 2 and hide form 1 (89 mb memory usage

situation 2
start app with form 1 (72mb memory usage), minimize form 1 (2.6mb), normalize form 1 (6.3mb), show form 2 and hide form 1 (53 mb memory usage), minimize form 2 (1.6mb), normalize form 2 (23mb

What's going on here? And how can i get to the same - smaller - usage of memory without having to do tricks like codewise minimizing/normalizing each form when shown
Is this the garbage collector

I could use some feedback here as I would really like to make the memory footprint of my app much smaller

thanx
t

Cor
Guest
 
Posts: n/a
#2: Jul 21 '05

re: memory usage


Hi Tomvr,

Search on google the dotnet groups, you will see a lot of things about
memory usage, also the one you mention. I did not test it myself but you
will probably read that all things with hiding the form are only a
presentation in the taskmanager. The actual memory does not change.

Untill now we never saw a method to manage the memory usage ourself in a
managed code program.

Just my 2 eurocent.

Cor
[color=blue]
>
> I have noticed some 'weird' memory usage in a vb.net windows app.
> The situation is as follows:
> I have an app (heavy on images) with 2 forms
> (actually there are more forms and on starting the app I load some things[/color]
into memory for global use of the app but I'll use only 2 starting forms to
explain the situation).[color=blue]
>
> situation 1)
> start app with form 1 (72mb memory usage), show form 2 and hide form 1 (89[/color]
mb memory usage)[color=blue]
>
> situation 2)
> start app with form 1 (72mb memory usage), minimize form 1 (2.6mb),[/color]
normalize form 1 (6.3mb), show form 2 and hide form 1 (53 mb memory usage),
minimize form 2 (1.6mb), normalize form 2 (23mb)[color=blue]
>
>
> What's going on here? And how can i get to the same - smaller - usage of[/color]
memory without having to do tricks like codewise minimizing/normalizing each
form when shown?[color=blue]
> Is this the garbage collector?
>
> I could use some feedback here as I would really like to make the memory[/color]
footprint of my app much smaller.[color=blue]
>
> thanx,
> t[/color]


Willy Denoyette [MVP]
Guest
 
Posts: n/a
#3: Jul 21 '05

re: memory usage


See inline ***
Willy.

"Cor" <non@non.com> wrote in message
news:u$xDaECBEHA.744@TK2MSFTNGP10.phx.gbl...[color=blue]
> Hi Tomvr,
>
> Search on google the dotnet groups, you will see a lot of things about
> memory usage, also the one you mention. I did not test it myself but you
> will probably read that all things with hiding the form are only a
> presentation in the taskmanager. The actual memory does not change.
>[/color]
*** This is the normal windows behavior since NT4 (SP2 i guess),
applications that have their top level window minimized are assumed to be
idl, as a result, the OS trims the process working set to a mininimum.
[color=blue]
> Untill now we never saw a method to manage the memory usage ourself in a
> managed code program.
>[/color]
*** Applications shouldn't - and can't adequately - manage memory usage,
that's exactly why OS and runtimes like the CLR are built for.
[color=blue]
> Just my 2 eurocent.
>
> Cor
>[color=green]
>>
>> I have noticed some 'weird' memory usage in a vb.net windows app.
>> The situation is as follows:
>> I have an app (heavy on images) with 2 forms
>> (actually there are more forms and on starting the app I load some things[/color]
> into memory for global use of the app but I'll use only 2 starting forms
> to
> explain the situation).[color=green]
>>
>> situation 1)
>> start app with form 1 (72mb memory usage), show form 2 and hide form 1
>> (89[/color]
> mb memory usage)[color=green]
>>
>> situation 2)
>> start app with form 1 (72mb memory usage), minimize form 1 (2.6mb),[/color]
> normalize form 1 (6.3mb), show form 2 and hide form 1 (53 mb memory
> usage),
> minimize form 2 (1.6mb), normalize form 2 (23mb)[color=green]
>>
>>
>> What's going on here? And how can i get to the same - smaller - usage of[/color]
> memory without having to do tricks like codewise minimizing/normalizing
> each
> form when shown?[color=green]
>> Is this the garbage collector?
>>
>> I could use some feedback here as I would really like to make the memory[/color]
> footprint of my app much smaller.[color=green]
>>
>> thanx,
>> t[/color]
>
>[/color]


Closed Thread