Solved

memory avalible

Posted on 1998-09-06
9
169 Views
Last Modified: 2010-04-06
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
0
Comment
Question by:asi
  • 6
  • 2
9 Comments
 
LVL 5

Accepted Solution

by:
ronit051397 earned 30 total points
ID: 1338795
procedure TForm1.Button1Click(Sender: TObject);
var  FVer: TOSVERSIONINFO;
     MS: TMemoryStatus;
begin
    GlobalMemoryStatus(MS);
    showmessage('Physical memory available: '+FormatFloat('#,###" KB"', MS.dwAvailPhys/1024));
end;

0
 
LVL 2

Expert Comment

by:kjteng
ID: 1338796
For delphi 1 use MemAvail and MaxAvail function
0
 

Author Comment

by:asi
ID: 1338797
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
 
LVL 5

Expert Comment

by:ronit051397
ID: 1338798
I have tested it on NT4. You work on 95?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 5

Expert Comment

by:ronit051397
ID: 1338799
I have tested it on NT4. You work on 95?
0
 
LVL 5

Expert Comment

by:ronit051397
ID: 1338800
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
 

Author Comment

by:asi
ID: 1338801
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
 
LVL 5

Expert Comment

by:ronit051397
ID: 1338802
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
 
LVL 5

Expert Comment

by:ronit051397
ID: 1338803
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

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now