HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- memory test program
Operating System - HP-UX
1833106
Members
3129
Online
110051
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2001 11:53 PM
10-04-2001 11:53 PM
Hi all,
I would like to create a C program to grab a huge chunk of memory to test out that out kernel parameters are right and force our system to swap a bit to check out performance. Does someone have a C program that can do this for me please ? I would be very grateful. Thanks!
I would like to create a C program to grab a huge chunk of memory to test out that out kernel parameters are right and force our system to swap a bit to check out performance. Does someone have a C program that can do this for me please ? I would be very grateful. Thanks!
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2001 11:56 PM
10-04-2001 11:56 PM
SolutionHeres a piece of code that will do it;
#define NULL 0
main()
{
int ptr;
ptr = NULL;
ptr = datalock(2000000000,50000);
sleep(15);
}
Stick it in a file, eg. test.c, and compile with +DA2.0w (64bit);
cc +DA2.0w -o test test.c
Then run test, and from another window running top you will see a 2GB process start - and stop 15 secs later. If you dont have enough free ram or maxdsiz_64bit is too low you will get a not enough space error.
Im from Palmerston North, New Zealand, but somehow ended up in London...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2001 12:03 AM
10-05-2001 12:03 AM
Re: memory test program
Thanks Stefan!
But why use datalock, I thought you would use malloc ?
Carol
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2001 12:09 AM
10-05-2001 12:09 AM
Re: memory test program
malloc only allocates the space in memory, it doesnt reserve it which means it doesnt actually use up that amount of memory, whereas datalock locks the memory - which means its marked as not useable to the system and thus causes the performance impact you are after. You can see the difference if you run the program and use top or vmstat to monitor memory usage.
Im from Palmerston North, New Zealand, but somehow ended up in London...
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP