NO

Author Topic: Memory Saving Tips Required  (Read 4384 times)

grom-it

  • Guest
Memory Saving Tips Required
« on: September 26, 2007, 01:12:54 AM »
I am currently writing a small pocket pc application that is to do with my line of work

As i have poor eyesight i have written it using window and controls created at run time that allow me to use larger text

i have 18 buttons (12 of which form a numerical keypad), 2 edit boxes and a combo box control
all of which are hidden and shown as required.

I have also read somewhere that on a pocket pc
! Globals are better than locals !
I find that very unconventional.

My question is that whilst my app is working ok
it would be nice if i had a better understanding of how i might save some memory should the need arise.
Any links or advice would be appreciated.
BTIA

grom-it

  • Guest
Re: Memory Saving Tips Required
« Reply #1 on: September 27, 2007, 02:50:48 PM »
I think i should Rephrase this question

What i am asking is
Can I ? and should I ?
Be destroying and recreating windows on the fly to save memory

JohnF

  • Guest
Re: Memory Saving Tips Required
« Reply #2 on: September 27, 2007, 06:57:25 PM »
I think i should Rephrase this question

What i am asking is
Can I ? and should I ?
Be destroying and recreating windows on the fly to save memory

My opinion is no, once you have created a window best to leave it until your app closes.

I also find "Globals are better than locals" strange. Maybe the Pocket PC has a small stack but provided your local vars are not huge it shouldn't be a problem.

John

audiofish

  • Guest
Re: Memory Saving Tips Required
« Reply #3 on: September 28, 2007, 10:22:23 PM »
I can't see using globals everywhere a benefit; in fact I'd say it uses more memory - you'd have unused variables hanging around which aren't storing anything useful between function calls, leaving it unavailable for other uses.