Code Comments
Programming Forum and web based access to our favorite programming groups.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.
Post Follow-up to this messageHello,
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.
>
>
Post Follow-up to this messageThank 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...
>
>
Post Follow-up to this messageActually, 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... > >
Post Follow-up to this messageThis 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 > >
Post Follow-up to this messageHe 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 Basically, > I > certain > is for 1024); > to > >
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.