Operating System - HP-UX
1833762 Members
2345 Online
110063 Solutions
New Discussion

Script for stress test memory utilization

 
freddy_21
Respected Contributor

Script for stress test memory utilization

anybody have script for stress memory utilization. I am learning about PRM, but my memory utilization cant meet with my PRM's configuration.

Thanks
Freddy
5 REPLIES 5
H.Merijn Brand (procura
Honored Contributor

Re: Script for stress test memory utilization

Use perl :)

--8<---
#!/usr/bin/perl

use strict;
use warnings;

fork for 1 .. 5;
for (1 .. 10000) {
my $a = "xxxxx" x int rand 1_000_000;
my $b = ~$a;
my $c = reverse $b;
}
-->8---

That should stress mem quite a bit

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
Victor Fridyev
Honored Contributor

Re: Script for stress test memory utilization

Hi,

Try this one:
Run some dd commands using as input device different disks:

dd if=/dev/dsk/cXXXX of=/dev/null bs=32768k


HTH
Entities are not to be multiplied beyond necessity - RTFM
H.Merijn Brand (procura
Honored Contributor

Re: Script for stress test memory utilization

That is an IO stress, not a memory stress

I couldn't think of a real memory stress that would not somehow also stress the CPU.

When I used this:
--8<---
use strict;
use warnings;

fork for 1 .. 5;
for (1 .. 10000) {
my $a = "xxxx" x 10_000_000;
my $b = reverse $a;
}
-->8---

Memory started sky-rocketing, and the system started swapping. You would need to find the point where the system doesn't swap (yet)

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
H.Merijn Brand (procura
Honored Contributor

Re: Script for stress test memory utilization

That is an IO stress, not a memory stress

I couldn't think of a real memory stress that would not somehow also stress the CPU.

When I used this:
--8<---
use strict;
use warnings;

fork for 1 .. 5;
for (1 .. 10000) {
my $a = "xxxx" x 10_000_000;
my $b = reverse $a;
}
-->8---

Memory started sky-rocketing, and the system started swapping. You would need to find the point where the system doesn't swap (yet)

Enjoy, Have FUN! H.Merijn
Enjoy, Have FUN! H.Merijn
freddy_21
Respected Contributor

Re: Script for stress test memory utilization

i already test with that script. The script worked with perfect... Thanks