Board index » delphi » How to reduce memory usage?
AntoineHotmai
![]() Delphi Developer |
Tue, 08 Jun 2004 23:08:25 GMT
|
AntoineHotmai
![]() Delphi Developer |
Tue, 08 Jun 2004 23:08:25 GMT
How to reduce memory usage?
Almost all my apps use about 4000Ko of memory, and i don't know how to make
them use less. I'm builing a background application, and it cannot be usefull if it uses 4megs. Any suggestion? |
J Fren
![]() Delphi Developer |
Wed, 09 Jun 2004 00:26:23 GMT
Re:How to reduce memory usage?Well, you could describe your app 4mb seems a bit large - perhaps you are doing something daft The 'Almost all' bit suggests that you are using something in common Occam's razor is the (most appropriate) solution. On Fri, 21 Dec 2001 16:08:25 +0100, "AntoineHotmail" Quote<antoine...@hotmail.com> wrote: |
AntoineHotmai
![]() Delphi Developer |
Wed, 09 Jun 2004 00:51:48 GMT
Re:How to reduce memory usage?Ok, 4 is exagerated, let's say three and a half. For example, one is a database i use to manage the CD I burn, and another is a PPPoE-autodialer. There's not much code because i'm still a beginner, and i don't know how to optimize this code. And the thing i use in common for all apps is (only) Delphi6. I write with it and i compile with it. The exe is a stand alone. I thought about building a Dll, but there are only 3 or 4 procedures i would only put in it. @+ "J French" <je...@iss.u-net.com> a crit dans le message de news: Quote> Well, you could describe your app |
Bruce Robert
![]() Delphi Developer |
Wed, 09 Jun 2004 01:25:49 GMT
Re:How to reduce memory usage?Quote"AntoineHotmail" <antoine...@hotmail.com> wrote in message Quote> Almost all my apps use about 4000Ko of memory, and i don't know how to wouldn't worry about an application using 0.4% of any resource. |
Terry Russel
![]() Delphi Developer |
Wed, 09 Jun 2004 03:44:29 GMT
Re:How to reduce memory usage?Quote"AntoineHotmail" <antoine...@hotmail.com> wrote in message Quote> Almost all my apps use about 4000Ko of memory, and i don't know how to How much is actually committed memory and how much reserved? Reserved virtual memory and heap is not necessarily assigned to ram/hd See Win32 VirtualQuery and MEMORY_BASIC_INFORMATION structure Decreasing the reported memory use is only cosmetic depending on what libraries you need you could add this code to the dpr there are many other ways but they are mostly cosmetic, are a lot of effort Now, if only the users would understand :-( Perhaps you could document var b:boolean; |
Stephe
![]() Delphi Developer |
Wed, 09 Jun 2004 06:24:46 GMT
Re:How to reduce memory usage?Quote"J French" <je...@iss.u-net.com> wrote in message Quote> Well, you could describe your app ... whoah.. Its there! DAMN YOU MICROSOFT! Quote
EXE file size, or actual memory use? 4Meg for an EXE is extremly excessive even for an EXE though. What variables are you declaring? Do you have Built-In Debugging turned on? |
Bruce Robert
![]() Delphi Developer |
Wed, 09 Jun 2004 09:54:15 GMT
Re:How to reduce memory usage?Quote"Stephen" <idontk...@somewhere.asdf> wrote in message news:2LOU7.34565 entire exe on start-up. More over, if one wants to write a good looking GUI, much of an exe is going to be taken up with data for the interface. |
Craig Reynold
![]() Delphi Developer |
Wed, 09 Jun 2004 11:57:26 GMT
Re:How to reduce memory usage?your right that 4 meg isn't much. The people I started work for recently have 2 products that are about 8 and 11 meg, and they use an old DOS style interface :) -- Quote"Bruce Roberts" <b...@bounceitattcanada.xnet> wrote in message Quote
|
Emil Bel
![]() Delphi Developer |
Wed, 09 Jun 2004 20:12:27 GMT
Re:How to reduce memory usage?In article <9vvjdv$se...@wanadoo.fr>, antoine...@hotmail.com says... Quote> Almost all my apps use about 4000Ko of memory, and i don't know how to make Some people has bad habbit of adding components that does some functions that otherwise could be written in 20 lines of code without it... Then, experimenting with many components and deleting them, whoithout checking if they are really cleared from USES list... -- |
Bj?rge S?the
![]() Delphi Developer |
Wed, 09 Jun 2004 20:23:46 GMT
Re:How to reduce memory usage?"Craig Reynolds" <reynoldscra...@hotmail.com> skrev i melding news:3c2403b6$0$30887@echo-01.iinet.net.au... Quote> your right that 4 meg isn't much. The people I started work for recently record so far is 1.8 MB, and then I'd been putting stuff into it for months...it even has a large splash screen image...;-) But - to the original question: What Windows reports isn't necessarily |
Craig Reynold
![]() Delphi Developer |
Wed, 09 Jun 2004 23:26:01 GMT
Re:How to reduce memory usage?I'm not sure about NT reporting a larger figure than 9x, I don't recall ever hearing that, but that doesn't mean much. As for being generous with graphics for the apps, not really. I imagine the size comes from the fact that they both have more than 2 million lines of code in them. -- Quote"Bj?rge S?ther" <REMOVE_bsaether@THIS_online.no> wrote in message Quote> "Craig Reynolds" <reynoldscra...@hotmail.com> skrev i melding |
Stephe
![]() Delphi Developer |
Thu, 10 Jun 2004 06:38:08 GMT
Re:How to reduce memory usage?Quote"Bj?rge S?ther" <REMOVE_bsaether@THIS_online.no> wrote in message Quote> "Craig Reynolds" <reynoldscra...@hotmail.com> skrev i melding public availability. The first version of the software was developed under VB, and its code, including the OCXs and everything else it deemed necessary (All I was using was strictly basic commands, and basic components. Nothing like storing BMPs) for a small app, I couldn't fit it on a simple floppy disk. Under D3 (At the time thats what I was using) I compiled, and managed to nail under 100K. My record for my comercial product is 1.6meg in size. And for what this program is doing, it does a LOT. Quote
OS of any style keep that memory available to the program short term? Under 9x/NT, we don't have direct access to memory (Can't poke at $b800:0000 directly to change the top left character on a colour monitor anymore. *sigh*) So, maybe as part of efficiceny as far as memory management goes, it keeps that segment of memory available to the app, just incase it needs more? Sounds dumb, but, who knows. <grin> Quote> -- |
Sundial Service
![]() Delphi Developer |
Thu, 10 Jun 2004 22:52:49 GMT
Re:How to reduce memory usage?"Memory" is all virtual anyway, and it's often over-stated depending on exactly how it is calculated. What matters is how much memory is in your active "working set" while It also matters how much "swapping" the program generates while the Again... Windows doesn't care much how large your _virtual memory Quote>AntoineHotmail wrote: Sundial Services :: Scottsdale, AZ (USA) :: (480) 946-8259 mailto:i...@sundialservices.com (PGP public key available.) Quote> Fast(!), automatic table-repair with two clicks of the mouse! |
Bj?rge S?the
![]() Delphi Developer |
Mon, 14 Jun 2004 18:40:31 GMT
Re:How to reduce memory usage?"Craig Reynolds" <reynoldscra...@hotmail.com> skrev i melding news:3c24a519$0$30889@echo-01.iinet.net.au... Quote> I'm not sure about NT reporting a larger figure than 9x, I don't recall believe that explains the difference ;-) Quote> ~~~~~~~~~~~~~ Bjoerge Saether Asker, Norway bjorge@hahaha_itte.no (remve the obvious) |
AntoineHotmai
![]() Delphi Developer |
Tue, 15 Jun 2004 22:44:30 GMT
Re:How to reduce memory usage?Wow, this is too much for me. I'm just a beginner... When i talk about memory usage, it's what i see with the task manager of windows (XP) My exe is just about 500 Ko on hardisk, and there's not that much variables. But in fact, i've let my app on for a long time, and seems that it uses less and less memory. After about 4 hours of running, it just uses 392 ko (always with task manager). Thanks to all for your answers. |