Solved

memory avalible

Posted on 1998-09-06
9
172 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

733 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