Page 1 of 1

Freeing Resources from Gadgets

Posted: Tue Nov 13, 2007 1:07 pm
by Baslo
Hi,

i wrote a small application that uses the Webgadget. The app takes up approx. 13 MB of RAM. Now what i'm trying to do is:

If the Window is set to invisible (e.g via HideWindow()) i want the Memory to be freed. Most of the 13 MB is used by the WebGadget, i think. Is there a way to unload Gadgets (couldn't find a solution in the forums/docs), or do i have a logical problem? How would you solve that problem?

Thanks in Advance,
Baslo

Posted: Tue Nov 13, 2007 1:09 pm
by srod
Can you not just free the webgadget if this really is the source of the memory consumption? Rebuild it whenever the window is unhidden etc.

Posted: Tue Nov 13, 2007 1:46 pm
by Baslo
Yeah i looked for a function to do that but i couldn't find anything helpful.
I tried SetGadgetState() but the memory consumption remained the same.

Is there a function that removes Gadgets completely (visual and from memory)? And would that be recommended?

Posted: Tue Nov 13, 2007 1:51 pm
by srod
FreeGadget().

Re: Freeing Resources from Gadgets

Posted: Tue Nov 13, 2007 2:34 pm
by horst
Baslo wrote:If the Window is set to invisible (e.g via HideWindow()) i want the Memory to be freed. Most of the 13 MB is used by the WebGadget, i think.
If you minimize the window before hiding, it looks a lot better in Windows' Task Manager ;)

Posted: Tue Nov 13, 2007 2:35 pm
by Baslo
Thanks.
But unfortunately only 1 MB will be freed.
When i omit the WebGadget completely the app uses only 2.5 MB RAM.

Re: Freeing Resources from Gadgets

Posted: Tue Nov 13, 2007 3:06 pm
by Baslo
horst wrote:
Baslo wrote:If the Window is set to invisible (e.g via HideWindow()) i want the Memory to be freed. Most of the 13 MB is used by the WebGadget, i think.
If you minimize the window before hiding, it looks a lot better in Windows' Task Manager ;)
Sorry i missed your post. Works perfectly; when in Systray-Status only 4.5 MB RAM. The revoke is now slower, though.

Thank you, guys

Posted: Tue Nov 13, 2007 3:14 pm
by Baslo
Ah ok, just for the record:

It's not slow. The freeing of gadgets (FreeGadget()) is useless, just minimize the window and everything is alright: speed good, memory good.

I'm in love with PB.