From owner-freebsd-questions@freebsd.org Sat Jun 2 22:41:23 2018 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60276FF1846 for ; Sat, 2 Jun 2018 22:41:23 +0000 (UTC) (envelope-from john@thehowies.com) Received: from remote.thehowies.com (remote.thehowies.com [50.197.91.218]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "remote.thehowies.com", Issuer "RapidSSL SHA256 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CA2187E416 for ; Sat, 2 Jun 2018 22:41:22 +0000 (UTC) (envelope-from john@thehowies.com) Received: from PRIMARY.thehowies.local ([fe80::6437:d031:7477:6451]) by PRIMARY.thehowies.local ([fe80::6437:d031:7477:6451%10]) with mapi id 14.03.0382.000; Sat, 2 Jun 2018 15:40:54 -0700 From: John Howie To: Brennan Vincent CC: "freebsd-questions@freebsd.org" Subject: Re: Is it normal that a user can take down the whole system by using too much memory? Thread-Topic: Is it normal that a user can take down the whole system by using too much memory? Thread-Index: AQHT+r/j/zD/VmQpGkCFdYNvAEE9PKRNkARK Date: Sat, 2 Jun 2018 22:40:52 +0000 Message-ID: <01EE7EEA-03AC-4D71-BA08-B0CEA97EE720@thehowies.com> References: <1527977770.2651378.1394286400.0806CC5C@webmail.messagingengine.com> In-Reply-To: <1527977770.2651378.1394286400.0806CC5C@webmail.messagingengine.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Jun 2018 22:41:23 -0000 Hi Brennan, Do =91man -k limit=92 for details of means to restrict resource consumption= . In particular, check out limits(1) and rctl(8). Variations of this problem have been around forever. An oldie but goldie is= : main () { while (1) { fork (); } } I cannot say why you are getting the results you see on your specific syste= m. I would check limits to see where they are set, and tweak them. Cheers, John Sent from my iPhone > On Jun 2, 2018, at 15:20, Brennan Vincent wrote: >=20 > The attached program `eatmem.c` is a simple example to waste N gigs of me= mory as quickly as possible. >=20 > When I run something like `eatmem 32` (on a system with less than 32GB of= RAM), about half the time everything works fine: the system quickly runs o= ut of RAM and swap, the kernel kills `eatmem`, and everything recovers. How= ever, the other half of the time, the system becomes completely unusable: m= y ssh session is killed, important processes like `init` and `getty` are ki= lled, and it's impossible to even log into the system (the local terminal i= s unresponsive, and I can't ssh in because sshd is killed immediately whene= ver it tries to run). The only way to recover is by rebooting. >=20 > Is this expected behavior? >=20 > My system details are as follows: > FreeBSD 12 CURRENT x86_64 guest on VMWare Fusion. > ram: 8 GB > swap: 1 GB > Host: macbook pro running macOS. > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.o= rg"