Re: killed: out of swap

2022-06-14 Thread Michael van Elst
b...@softjar.se (Johnny Billquist) writes: >I don't see any realistic way of doing anything with that. >It's basically the first process that tries to allocate another page >when there are no more. There are no other processes at that moment in >time that have the problem, so why should any of

Re: killed: out of swap

2022-06-14 Thread Mouse
>> > I have a program that keeps malloc()ing (and scribbling a bit >> > into the allocated memory) until malloc() fails. The >> > intention is to put pressure on the VM system to find out how >> > much pool cache memory it can reclaim. >> Such a program would be a prime

Re: killed: out of swap

2022-06-14 Thread David Holland
On Tue, Jun 14, 2022 at 07:59:33PM +0200, Johnny Billquist wrote: > > What might be interesting is a way to influence the order in which > > processes are chosen to kill... > > I don't see any realistic way of doing anything with that. > It's basically the first process that tries to

Re: killed: out of swap

2022-06-14 Thread Mouse
>> > I have a program that keeps malloc()ing (and scribbling a bit >> > into the allocated memory) until malloc() fails. The >> > intention is to put pressure on the VM system to find out how >> > much pool cache memory it can reclaim. >> Such a program would be a prime

Re: killed: out of swap

2022-06-14 Thread Brian Buhrow
hello. Is this something madvise(2) could be extended to do? -thanks -Brian On Jun 14, 2:47pm, Mouse wrote: } Subject: Re: killed: out of swap } >> What might be interesting is a way to influence the order in which } >> processes are chosen to kill... } > I don't see any realistic way

Re: killed: out of swap

2022-06-14 Thread Johnny Billquist
On 2022-06-14 20:47, Mouse wrote: What might be interesting is a way to influence the order in which processes are chosen to kill... I don't see any realistic way of doing anything with that. It's basically the first process that tries to allocate another page when there are no more. There

Re: killed: out of swap

2022-06-14 Thread Mouse
>> What might be interesting is a way to influence the order in which >> processes are chosen to kill... > I don't see any realistic way of doing anything with that. It's > basically the first process that tries to allocate another page when > there are no more. There are no other processes at

Re: killed: out of swap

2022-06-14 Thread Johnny Billquist
On 2022-06-14 19:57, David Brownlee wrote: On Tue, 14 Jun 2022 at 13:33, Robert Elz wrote: NetBSD implements overcommitted swap - many processes malloc() (or mmap() which that really becomes in the current implementation) far more memory than they're ever going to actually use. It is only

Re: killed: out of swap

2022-06-14 Thread David Brownlee
On Tue, 14 Jun 2022 at 13:33, Robert Elz wrote: > > NetBSD implements overcommitted swap - many processes malloc() > (or mmap() which that really becomes in the current implementation) > far more memory than they're ever going to actually use. It is only > when some real physical memory is

Re: killed: out of swap

2022-06-14 Thread Edgar Fuß
> I assume my impression is completely wrong (today). OK, thanks for all the explanations and insights.

Re: killed: out of swap

2022-06-14 Thread Robert Elz
NetBSD implements overcommitted swap - many processes malloc() (or mmap() which that really becomes in the current implementation) far more memory than they're ever going to actually use. It is only when some real physical memory is required (rather than simply a marker "zero filled page might be

Re: killed: out of swap

2022-06-14 Thread Mouse
> I have a program that keeps malloc()ing (and scribbling a bit into > the allocated memory) until malloc() fails. The intention is to put > pressure on the VM system to find out how much pool cache memory it > can reclaim. > When I run that program (with swap space unconfigured), it doesn't >

Re: killed: out of swap

2022-06-14 Thread Johnny Billquist
On 2022-06-14 12:59, Edgar Fuß wrote: So what should the kernel do? I don't know how thigs work under the hood today (I might have partially known in the times of sbrk()), but I would suppose that malloc() will ultimatively result in some system call enlarging the heap/data segment/whatever.

Re: killed: out of swap

2022-06-14 Thread Edgar Fuß
> So what should the kernel do? I don't know how thigs work under the hood today (I might have partially known in the times of sbrk()), but I would suppose that malloc() will ultimatively result in some system call enlarging the heap/data segment/whatever. That system call could simply fail. I

Re: killed: out of swap

2022-06-14 Thread Johnny Billquist
It's not the malloc that fails. It's the vm system trying to get a page for you. At which point it might not be your process that is trying to get a page when there are none free... So what should the kernel do? Johnny On 2022-06-14 12:01, Edgar Fuß wrote: I have a program that keeps

killed: out of swap

2022-06-14 Thread Edgar Fuß
I have a program that keeps malloc()ing (and scribbling a bit into the allocated memory) until malloc() fails. The intention is to put pressure on the VM system to find out how much pool cache memory it can reclaim. When I run that program (with swap space unconfigured), it doesn't terminate