9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] plan 9 overcommits memory?
@ 2007-09-03  3:38 geoff
  2007-09-03  5:35 ` Scott Schwartz
                   ` (3 more replies)
  0 siblings, 4 replies; 74+ messages in thread
From: geoff @ 2007-09-03  3:38 UTC (permalink / raw)
  To: 9fans

If system calls were the only way to change memory allocation, one
could probably keep a strict accounting of pages allocated and fail
system calls that require more VM than is available.  But neither Plan
9 nor Unix works that way.  The big exception is stack growth.  The
kernel automatically extends a process's stack segment as needed.  On
the pc, Plan 9 currently limits user-mode stacks to 16MB.  On a CPU
server with 200 processes (fairly typical), that's 3.2GB of VM one
would have to commit just for stacks.  With 2,000 processes, that
would rise to 32GB just for stacks.



^ permalink raw reply	[flat|nested] 74+ messages in thread
* [9fans] plan 9 overcommits memory?
@ 2007-08-31 11:41 erik quanstrom
  2007-09-02 21:27 ` Russ Cox
  0 siblings, 1 reply; 74+ messages in thread
From: erik quanstrom @ 2007-08-31 11:41 UTC (permalink / raw)
  To: 9fans

i was trying to tickle a kernel panic, but instead
i think i found a bug.  this program was run on
a machine with 1800 MB user space available.
(3552/464510 user)

	#include<u.h>
	#include<libc.h>
	
	enum{
		Big	= 1024*1024*1790,
	};
	
	void
	main(void)
	{
		char *p;
		ulong i;
	
		p = malloc(Big);
		if(p == 0)
			sysfatal("malloc: %r");
		memset(p, 0, Big);
		exits("");
	}

the result was

	ladd# out of physical memory; no swap configured
	364: 8.out killed: out of memory

this means that the malloc *succeeded* it wasn't until i forced
the pagefault with the memset that i ran out of memory.  what's
going on here?

- erik


^ permalink raw reply	[flat|nested] 74+ messages in thread

end of thread, other threads:[~2007-09-10 15:24 UTC | newest]

Thread overview: 74+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-03  3:38 [9fans] plan 9 overcommits memory? geoff
2007-09-03  5:35 ` Scott Schwartz
2007-09-03  6:05   ` Uriel
2007-09-03 13:33   ` erik quanstrom
2007-09-03 17:09     ` john
2007-09-03 17:17       ` Gorka Guardiola
2007-09-03 17:25         ` Francisco J Ballesteros
2007-09-03 17:30         ` john
2007-09-03 19:47           ` Charles Forsyth
2007-09-03 19:46         ` Uriel
2007-09-03 19:54           ` Charles Forsyth
2007-09-03 19:54             ` Uriel
2007-09-03 20:34               ` geoff
2007-09-03 20:16             ` erik quanstrom
2007-09-03 17:32       ` erik quanstrom
2007-09-03 17:39         ` Francisco J Ballesteros
2007-09-03 17:43         ` john
2007-09-03 17:45           ` john
2007-09-03 19:52             ` Charles Forsyth
2007-09-05  8:33         ` sqweek
2007-09-04  8:48       ` Douglas A. Gwyn
2007-09-03 18:13   ` geoff
2007-09-03 20:17     ` erik quanstrom
2007-09-03 20:48       ` geoff
2007-09-03 22:01         ` erik quanstrom
2007-09-03 22:43           ` Charles Forsyth
2007-09-03 23:51             ` erik quanstrom
2007-09-04  0:04               ` Charles Forsyth
2007-09-04 14:44                 ` erik quanstrom
2007-09-04 15:07                   ` Charles Forsyth
2007-09-04 15:18                     ` ron minnich
2007-09-04 15:18                     ` Charles Forsyth
2007-09-05  8:48                       ` Douglas A. Gwyn
2007-09-05 10:53                         ` erik quanstrom
2007-09-06  8:42                           ` Douglas A. Gwyn
2007-09-06 17:15                             ` Joel C. Salomon
2007-09-06 19:38                               ` ron minnich
2007-09-06 20:18                                 ` Charles Forsyth
2007-09-06 23:37                                 ` Steve Simon
2007-09-07  3:09                                 ` Roman Shaposhnik
2007-09-07  4:09                                   ` Bruce Ellis
2007-09-07  4:25                                     ` Lyndon Nerenberg
2007-09-07  4:37                                       ` Bruce Ellis
2007-09-07  4:43                                         ` Lyndon Nerenberg
2007-09-10 15:24                                         ` roger peppe
2007-09-07 10:55                                     ` erik quanstrom
2007-09-04 23:32                     ` erik quanstrom
2007-09-03 21:16       ` Charles Forsyth
2007-09-03 21:19         ` ron minnich
2007-09-03 21:41           ` Eric Van Hensbergen
2007-09-03 21:51           ` erik quanstrom
2007-09-03 13:21 ` erik quanstrom
2007-09-03 14:01   ` Sape Mullender
2007-09-03 14:32     ` erik quanstrom
2007-09-03 15:28       ` Sape Mullender
2007-09-04  4:32         ` lucio
2007-09-04  7:23 ` Dave Eckhardt
2007-09-04  8:48 ` Douglas A. Gwyn
  -- strict thread matches above, loose matches on Subject: below --
2007-08-31 11:41 erik quanstrom
2007-09-02 21:27 ` Russ Cox
2007-09-03  0:43   ` erik quanstrom
2007-09-04  8:47     ` Douglas A. Gwyn
2007-09-04 13:39       ` David Leimbach
2007-09-04 14:41         ` erik quanstrom
2007-09-04 15:54           ` David Leimbach
2007-09-04 17:37     ` sqweek
2007-09-04 18:10       ` ron minnich
2007-09-04 18:53         ` sqweek
2007-09-03  1:23   ` Scott Schwartz
2007-09-03  1:47     ` ron minnich
2007-09-03  2:11       ` erik quanstrom
2007-09-03  2:11       ` erik quanstrom
2007-09-04  8:48         ` Douglas A. Gwyn
2007-09-03  5:28       ` Scott Schwartz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).