- Community Home
- >
- Servers and Operating Systems
- >
- Legacy
- >
- Operating System - Tru64 Unix
- >
- Re: Swap space error
Categories
Company
Local Language
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
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
Community
Resources
Forums
Blogs
- 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
08-18-2005 08:32 PM
08-18-2005 08:32 PM
Swap space error
running the following program,
"Unable to obtain requested swap space".
There is no problem with the program;
I have freed the memory before forking
a new process. I would like to know is
this an expected behavior or a bug?
Here is the program which I have used
to get the error message. The swap mode
was set to eager while running the
program.
void main()
{
char *buf;
int pid=0;
buf=(char *)malloc(1024*1024*256);
if(buf)
free(buf);
else
printf("Malloc failed \n");
pid=fork();
printf("Pid is %d \n", pid);
}
Thanks, Bala S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2005 03:45 AM
08-22-2005 03:45 AM
Re: Swap space error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2005 06:21 AM
08-26-2005 06:21 AM
Re: Swap space error
In eager mode system preallocates swap ahead of time and depending on the arbitration logic, this might happen.
I suggest lazy mode for most environments unless a lot of performance planning has gone into the setting up.
thanks
DP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2005 01:31 PM
08-26-2005 01:31 PM
Re: Swap space error
I think this is an optimization thing for malloc-n-free such that the program always has the freed memory if it wants to malloc again. But, when it comes to forking, this could be a problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-26-2005 02:01 PM
08-26-2005 02:01 PM
Re: Swap space error
A much similar question is raised was raised back in 1998.
[HP Internal readers, check the DIGITAL_UNIX.NOTE file topic 2199]
The VM engineer at that time responded:
"fork() will attempt to reserve the required swap space in eager mode.
Since V4.0, vfork(2) supports lazy swap allocation for the child.
The assumption, of course, is that the child will exec immediately. Note that the child will modify (COW) at least the stack page that it is running on. Address space duplication is always done lazily, using COW mechanism."
This is not a bug, just an implementation choice that will be good for some, sub-optimal for others.
If this presents a problem, then the first order of business would seem to be to see whether you can use vfork, and next to allocate more swap space!
hth,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2005 05:18 PM
08-28-2005 05:18 PM
Re: Swap space error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2005 03:07 AM
08-30-2005 03:07 AM
Re: Swap space error
Thanks, Bala S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2005 03:08 AM
08-30-2005 03:08 AM
Re: Swap space error
-Bala S