Freeing Resources from Gadgets

Just starting out? Need help? Post your questions and find answers here.
Baslo
New User
New User
Posts: 9
Joined: Tue Oct 30, 2007 1:11 pm
Location: Beth Aramaye

Freeing Resources from Gadgets

Post 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
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post 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.
I may look like a mule, but I'm not a complete ass.
Baslo
New User
New User
Posts: 9
Joined: Tue Oct 30, 2007 1:11 pm
Location: Beth Aramaye

Post 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?
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

FreeGadget().
I may look like a mule, but I'm not a complete ass.
horst
Enthusiast
Enthusiast
Posts: 197
Joined: Wed May 28, 2003 6:57 am
Location: Munich
Contact:

Re: Freeing Resources from Gadgets

Post 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 ;)
Horst.
Baslo
New User
New User
Posts: 9
Joined: Tue Oct 30, 2007 1:11 pm
Location: Beth Aramaye

Post 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.
Baslo
New User
New User
Posts: 9
Joined: Tue Oct 30, 2007 1:11 pm
Location: Beth Aramaye

Re: Freeing Resources from Gadgets

Post 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
Baslo
New User
New User
Posts: 9
Joined: Tue Oct 30, 2007 1:11 pm
Location: Beth Aramaye

Post 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.
Post Reply