Operating System - HP-UX
1835515 Members
2866 Online
110078 Solutions
New Discussion

Re: How to limit the amount of used physical memory?

 
SOLVED
Go to solution
Olivier ROBERT
Frequent Advisor

How to limit the amount of used physical memory?

Dear forum readers,

We are running an application on an HP-UX 11.00 system, on which we need to run performance tests with different amounts of system memory. Of course, we can add and remove DIMMs as it comes necessary, but that is time-consuming. Eventually, I am pretty sure it is possible to do a far easier job adb'ing /stand/vmunix, and modifying some kernel parameter, or maybe at the ISL prompt, passing some parameter to "hpux". Hence , I put as many DIMMs as I may need, and then tell HP-UX to use only part of the available physical memory.

I'm pretty sure it is possible, but how?

Thanks for your help!

Olivier
17 REPLIES 17
Zafar A. Mohammed_1
Trusted Contributor

Re: How to limit the amount of used physical memory?

Pete Randall
Outstanding Contributor

Re: How to limit the amount of used physical memory?

Olivier,

Here's someone who was trying to do just what you are (though there is no indication that he succeeded or not):

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x1e4dba380869d71190080090279cd0f9,00.html


Pete

Pete
Jeff Schussele
Honored Contributor

Re: How to limit the amount of used physical memory?

Hi Olivier,

I'm not sure if you can toggle DIMMs on/off like you can CPUs.
But you can use HP's PRM (Process Resource Manager) SW to limit how much memory any or all processes can utilize.

Here's a link to it:

http://www.software.hp.com/cgi-bin/swdepot_parser.cgi/cgi/displayProductInfo.pl?productNumber=B3835DA

Rgds,
Jeff

PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Olivier ROBERT
Frequent Advisor

Re: How to limit the amount of used physical memory?

Thanks for your replies!

Zafar: I checked that list, but nothing looks really suitable. I could try to simulate less memory by changing some parameters, but I fear the side effects!

Pete: Thanks, but that guy too is fearing side effects. That by itself would make the test results unreliable.

Jeff: I've had a look at the PDC settings, but didn't see anything about memory deactivation. PRM is good, except that I guess it does affect userland memory activity only.

Well, maybe it's more tricky or more secret than I thought it would be, but there must be a way to make the kernel work with only a specified amount of memory... Something like the Linux "mem=..." parameter.
CCIL
Frequent Advisor

Re: How to limit the amount of used physical memory?

Hello ! i guess you can try to change the kernel parameter dbc_max_pct , it points to amount of physical memory used for example if u set to 15 , then the system will use the 15 % of your physical memory for the caching .
Amit Vichare
Olivier ROBERT
Frequent Advisor

Re: How to limit the amount of used physical memory?

Thanks Sarvesh, but dbc_max_pct is the maximum percentage of physical memory the system MAY use for caching. And anyway, even if I can force the system into using all that memory for caching, it's not what I need. I need the system to act really as if there was only a given amount of physical memory. I suspect the side effects too much!

Regards,

Olivier
Geoff Wild
Honored Contributor

Re: How to limit the amount of used physical memory?

Get HP's:
B3835BA C.01.06 HP Process Resource Manager

Costs money - but it is worth it.

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Olivier ROBERT
Frequent Advisor

Re: How to limit the amount of used physical memory?

Thanks Geoff, but I don't think HP PRM is really what I need. I need to specify the whole amount of used memory, and not only its use in userland, i.e. by processes, IPCs, etc... or can the PRM do that?

Olivier
Geoff Wild
Honored Contributor

Re: How to limit the amount of used physical memory?

You are right - it is limited to "managing resources by partitioning a system based on PRM groups. A PRM group is a collection of processes that is assigned system resources."

But, you could create your own group - which does absolutely nothing - and reserve say 1 GB of ram, 20% cpu, etc.

For more info check out:

http://h30081.www3.hp.com/products/prm/

Rgds...Geoff

Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Olivier ROBERT
Frequent Advisor

Re: How to limit the amount of used physical memory?

I doubt the system would not use some resources if they are free, especially if some kernel function asks for it. And even if it doesn't, I'm higly suspicious about the differences compared to a true DIMM removal... Anyway, I've had a look at the prices of PRM licenses, and my company wouldn't accept to pay that. They would prefer to pay me removing and putting the DIMMs back and forth... Ahem, maybe I should be paid more!

Regards,

Olivier
Bill Douglass
Esteemed Contributor

Re: How to limit the amount of used physical memory?

The following short c code (run as root) should lock down a memory segment of 100MB, sleep for 60 seconds, then frees the memory and exit (you can adjust and recompile as needed.)

I'm an admin, mot a coder, so I'll leave enhancements as an exercise to the reader :-)

Olivier ROBERT
Frequent Advisor

Re: How to limit the amount of used physical memory?

Thanks Bill, that may come useful, but I can't use that for my tests. One process taking n megabytes of physical memory is not the same as removing an n megabytes DIMM. Maybe I'm asking for too much, but I would like to modify the kernel in such a way that a "dmesg | grep Physical" gives me a lesser (and specified) amount of physical memory than it really has. And of course I need more than just a simple display change, I need that all kernel structures work accordingly with that specified value.

That is easily done with Linux, and I'm almost certain there is an easy way to do that with HP-UX too, but it looks undocumented...

Regards,

Olivier
Dietmar Konermann
Honored Contributor
Solution

Re: How to limit the amount of used physical memory?

Olivier,

You could use the -M option when launching the kernel, e.g.

ISL> hpux -M 131072

This restricts physmem logically to 512 MB (131072 pages 4K each).

Best regards...
Dietmar.
"Logic is the beginning of wisdom; not the end." -- Spock (Star Trek VI: The Undiscovered Country)
Jeff Schussele
Honored Contributor

Re: How to limit the amount of used physical memory?

Dietmar,

Is this another of these famous undocumented switches?
I see no mention of -M in the hpux man page.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Dietmar Konermann
Honored Contributor

Re: How to limit the amount of used physical memory?

Jeff,

well... that's true. But in fact, that options are not really top secret. Just try this with your boot disk:

# lifcp /dev/rdsk/cXtYdZ:HPUX - | strings | grep ^-

However, undocumented options are not guaranteed to work. They may be even removed for future releases without notice.

Best regards...
Dietmar.
"Logic is the beginning of wisdom; not the end." -- Spock (Star Trek VI: The Undiscovered Country)
Olivier ROBERT
Frequent Advisor

Re: How to limit the amount of used physical memory?

Thanks Dietmar, that EXACTLY looks like what I am looking for!

Jeff, good question, eventually I've had a look at the "man hpux", in the hope I would find that before asking the forums. I guess there is some reason why this was not documented, maybe "-M" is still an alpha or beta option, hence unsupported... Are there any other interesting switches like that? We love unsupported features eventually... :o)

Regards,

Olivier
Olivier ROBERT
Frequent Advisor

Re: How to limit the amount of used physical memory?

Thanks again, very interesting answers indeed!

Regards,

Olivier