Extend OS with GetProductInfo details

delphi package - madRes, madTools, madStrings, ...

Extend OS with GetProductInfo details

Postby pvanlogchem » Thu Aug 23, 2012 10:44 am

Could the TOS type be extended with the output of GetProductInfo (if this kernel32 API is available)?

And to be more specific : Could TOS.description be extended with a rendering of the specific Windows edition?
(Here's a piece of code that does exactly that : http://msdn.microsoft.com/en-us/library ... 29(v=vs.85).aspx)

(How silly btw, that Windows itself doesn't have an API to read the most complete version-string from...)

Thanks,
Patrick
pvanlogchem
 
Posts: 11
Joined: Tue Feb 09, 2010 1:05 pm
Location: Netherlands

Re: Extend OS with GetProductInfo details

Postby pvanlogchem » Thu Aug 23, 2012 10:56 am

On a related sidenote :

The reason why I would like to know this additional piece of versioning information, is to be able to look up the various limits a given Windows edition implies (like the maximum amount of physical memory supported by said edition - see http://msdn.microsoft.com/en-us/library ... 78(v=vs.85).aspx ).

I have no idea if these (and other) limits need to be coded out in one big case-statement, or if there's a way to read these limits right from the OS itself. But in any case it could be a good idea to add some tooling around this too...

Regards,
Patrick
pvanlogchem
 
Posts: 11
Joined: Tue Feb 09, 2010 1:05 pm
Location: Netherlands

Re: Extend OS with GetProductInfo details

Postby pvanlogchem » Thu Aug 23, 2012 11:06 am

Oh, and on an even deeper level, it'd be helpfull if we could somehow determine how much physical memory each proces is allowed to use...
And ideally it'd be even better if we would be able to tune THAT Windows parameter from within our code!

The thing is, now that we're running our software on 64 bit Windows, we've increased the amount of memory our processes may use.
But instead of improving performance, we seem to suffer even more from page-swapping than before we switched to 64 bit - and that's even though there's plenty of physical memory available in the (bare metal) machines we use! (Think in the order of 128 GB of memory and up)


Any ideas on what might be the cause for this (unwanted and premature) page-swapping?

Oh, and yeah, sorry if this is way out of context - Please point me in the right direction for getting an answer or solution for this rather unexpected and unpleasant behaviour...

Cheers,
Patrick

(Note, that most of the memory we use, is evenly devided between read-only memory-mapped files, and normally allocated virtual memory...)
pvanlogchem
 
Posts: 11
Joined: Tue Feb 09, 2010 1:05 pm
Location: Netherlands

Re: Extend OS with GetProductInfo details

Postby madshi » Wed Aug 29, 2012 9:24 am

I've no knowledge about your questions about physical memory etc, sorry.

I could probably add the code from that MS article to "madBasic.OS", but would it really help you that much? Do you plan to add a big "if OS.description = '...' then" for every possible combination of descriptions?

Have you looked into GlobalMemoryStatusEx? Doesn't that return the information you need?
madshi
Site Admin
 
Posts: 9411
Joined: Sun Mar 21, 2004 5:25 pm

Re: Extend OS with GetProductInfo details

Postby pvanlogchem » Thu Aug 30, 2012 7:33 am

Well, the extended OS description would be for logging purposes only (just having a more detailed description is good in any case).

As for GlobalMemoryStatusEx, this API returns what's physically available to Windows, not how much is actually present in the machine, nor does it tell the upper limit on the physical memory this Windows edition can handle.

As for the limit on how much (physical) memory each proces may use, there are a few things mentioned about that in the NT internals book, but it's rather complicated with all sorts of details about page pools, swap space, page table entries, a lazy writer, etc, etc, etc.
What I'm looking for is just a simple setting somewhere, that allows my proces to use loads of virtual memory, and not having to worry that there's a limit on how much physical memory is reserved for that (as this limit I'm experiencing still seems to result in swapping, which is NOT good for performance).
It makes no sense either, as there's plenty of physical memory present, and there are only a handfull of other processes that only use a fraction of the memory my process needs - so, why the swapping?!? No-one can tell me yet...

Anyway, thanks for the feedback, and good luck with adding Windows edition-details to TOS!

Cheers,
Patrick
pvanlogchem
 
Posts: 11
Joined: Tue Feb 09, 2010 1:05 pm
Location: Netherlands

Re: Extend OS with GetProductInfo details

Postby madshi » Thu Aug 30, 2012 8:09 am

I'll put that on my to do list, but to be honest, it's not top priority atm, sooooo many other important things to do.
madshi
Site Admin
 
Posts: 9411
Joined: Sun Mar 21, 2004 5:25 pm


Return to madBasic

Who is online

Users browsing this forum: No registered users and 1 guest