For Programmers: Free Programming Magazines  


Home > Archive > Delphi > March 2004 > RAM Component









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author RAM Component
Ville Valo

2004-03-27, 12:21 am

Does anyone know if there is a Delphi component that would alow me to
control how much RAM a particular application should use?

Thanks,
Ville.


Josef Koller

2004-03-27, 12:21 am

Hello,

this this a possible code:

procedure Tfinfo.FormCreate(Sender: TObject);

var
MS: TMemoryStatus;
begin
GlobalMemoryStatus(MS);
PhysMem.Caption := FormatFloat('#,###" KB"', MS.dwTotalPhys / 1024);
FreeRes.Caption := Format('%d %%', [MS.dwMemoryLoad]);
end;

You can find more about "GlobalMemoryStatus" in win32.hlp.


Ville Valo <ville@yahoo.com> schrieb in im Newsbeitrag:
4056b6f8$1_1@news.iprimus.com.au...
> Does anyone know if there is a Delphi component that would alow me to
> control how much RAM a particular application should use?
>
> Thanks,
> Ville.
>
>



Ville Valo

2004-03-27, 12:21 am

Thank you. I will try this.

Ville.

"Josef Koller" <koller.josef@t-online.de> wrote in message
news:c36i1u$gv9$07$1@news.t-online.com...
> Hello,
>
> this this a possible code:
>
> procedure Tfinfo.FormCreate(Sender: TObject);
>
> var
> MS: TMemoryStatus;
> begin
> GlobalMemoryStatus(MS);
> PhysMem.Caption := FormatFloat('#,###" KB"', MS.dwTotalPhys / 1024);
> FreeRes.Caption := Format('%d %%', [MS.dwMemoryLoad]);
> end;
>
> You can find more about "GlobalMemoryStatus" in win32.hlp.
>
>
> Ville Valo <ville@yahoo.com> schrieb in im Newsbeitrag:
> 4056b6f8$1_1@news.iprimus.com.au...
>
>



Ville Valo

2004-03-27, 12:21 am

Actually, just quickly glancing at the code, I straight away realised you
misunderstood my question. What your code will do is just display the
physical memory and free resources, but what I want to do to be able to
assign a certain amount of memory to a particular application. Basically, I
want to be able to manipulate memory so that one application gets a certain
amount of memory, and other application get less. For example, if a user is
playing a game then they would want to be able to assign enough memory for
the game to play properly.
I hope I can get some help with this.

Thanks,
Ville.


"Ville Valo" <ville@yahoo.com> wrote in message
news:40580df2$1_1@news.iprimus.com.au...
> Thank you. I will try this.
>
> Ville.
>
> "Josef Koller" <koller.josef@t-online.de> wrote in message
> news:c36i1u$gv9$07$1@news.t-online.com...
>
>



Bas

2004-03-27, 12:21 am

This sounds like an OS-task to me. An application can request memory with
the OS, it will allow or deny this request.

I don't think it is possible.

Bas

"Ville Valo" <ville@yahoo.com> wrote in message
news:405810c1_1@news.iprimus.com.au...
> Actually, just quickly glancing at the code, I straight away realised you
> misunderstood my question. What your code will do is just display the
> physical memory and free resources, but what I want to do to be able to
> assign a certain amount of memory to a particular application. Basically,

I
> want to be able to manipulate memory so that one application gets a

certain
> amount of memory, and other application get less. For example, if a user

is
> playing a game then they would want to be able to assign enough memory for
> the game to play properly.
> I hope I can get some help with this.
>
> Thanks,
> Ville.
>
>
> "Ville Valo" <ville@yahoo.com> wrote in message
> news:40580df2$1_1@news.iprimus.com.au...
to[color=darkred]
>
>



NoRemorse

2004-03-27, 12:21 am

He could override the default memory manager and write a new one. The new
memory manager would keep track of how much memory each program has
allocated already and would deny the request for memoryy if a certain quota
was met. There would be a performance loss with this, however.

Another way to do it would be to keep track of memory allocations in his
program and simply stop allocating if the limit is reached. That would
complicate the code, however.

Ville Vallo, why do you need this? And what do you need it for?

--
NoRemorse
"Expect me when you see me."

"Bas" <usenet.m.p.d.o.a@wiemie.nl> wrote in message
news:40597865$0$156$6c56d894@diablo.nl.easynet.net...
> This sounds like an OS-task to me. An application can request memory with
> the OS, it will allow or deny this request.
>
> I don't think it is possible.
>
> Bas
>
> "Ville Valo" <ville@yahoo.com> wrote in message
> news:405810c1_1@news.iprimus.com.au...
you[color=darkred]
Basically,[color=darkred]
> I
> certain
> is
for[color=darkred]
1024);[color=darkred]
> to
>
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com