Solved

memory avalible

Posted on 1998-09-06
9
174 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 5

Expert Comment

by:ronit051397
ID: 1338798
I have tested it on NT4. You work on 95?
0
 
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

705 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