memory avalible

hi
in my program i"m loading lots of data to the memory
how can i know how much memory avalible do i have (during run-time) ...
10x in advance
asi
asiAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
ronit051397Connect With a Mentor Commented:
procedure TForm1.Button1Click(Sender: TObject);
var  FVer: TOSVERSIONINFO;
     MS: TMemoryStatus;
begin
    GlobalMemoryStatus(MS);
    showmessage('Physical memory available: '+FormatFloat('#,###" KB"', MS.dwAvailPhys/1024));
end;

0
 
kjtengCommented:
For delphi 1 use MemAvail and MaxAvail function
0
 
asiAuthor Commented:
hi


first of al l i"m using delphi3
second i tried you answer and it give me according to your parameters (MS.dwAvailPhys)
0.
i also tried to use some other parameter from the TOSVERSIONINFO structure and some how
b4 the data upload and after i"m reciving the same answers  ...

have any idea ?
10x in advance
asi
b_asi@inter.net.il
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
ronit051397Commented:
I have tested it on NT4. You work on 95?
0
 
ronit051397Commented:
I have tested it on NT4. You work on 95?
0
 
ronit051397Commented:
In C:\Program Files\Borland\Delphi 3\Demos\RICHEDIT\Richedit.dpr
there is an example in the About Box.
I have tested it on 95 and the dwTotalPhys parameter showed the correct value.
0
 
asiAuthor Commented:
Take a look at that Demo

even if u fill the editor  with 100000000 lines
the memory used (at the about sub menu)  b4 and After is the same.
its not logic ....
Asi
maybe its a differnt memory location/part ?

0
 
ronit051397Commented:
Look at the following codes, they do the same:
http://www.borland.co.uk/devsupport/delphi/ti_list/TI3231.html
http://www.chami.com/tips/delphi/122496D.html

I have tried it and after closing some windows, available memory changed.
0
 
ronit051397Commented:
Notice that dwAvailPhys shows the amount of Physical memory available in your computer so that if you "finished" your Physical memory and start to use the virtual memory this parameter will show 0.
0
All Courses

From novice to tech pro — start learning today.