Re: Tcl under conditions of high memory usage.
- From: Alexandre Ferrieux <alexandre.ferrieux@xxxxxxxxx>
- Date: Fri, 30 Nov 2007 02:39:28 -0800 (PST)
On Nov 30, 5:48 am, "neuronst...@xxxxxxxxx" <neuronst...@xxxxxxxxx>
wrote:
Why does it have to error or panic?
Why can't it just wait?
It seems to me that a low memory condition on a machine may just be a
transient state,
Precisely when it's "transient" it's not an error at malloc() level.
Basically there are two situations:
- either the requested block fits in the VM (i.e RAM+swap has
enough free space *AND* the VM layout is not too fragmented so that
the heap can be grown contiguously to contain it), in which case
malloc() will succeed immediately. Further accesses may be slow due to
paging, which is your "transient" situation. But no failure.
- or the block doesn't fit, and malloc() fails definitively and
immediately.
Moreover, in the Linux case there is an additional "lie": the second
case nearly never occurs. Instead malloc says OK, and the access
itself may trigger a pass of OutOfMemoryKiller, which is a global
kernel mechanism hunting for memory-eaters with a delicate algorithm
balancing memory footprint, age, and recent activity. Notably it
doesn't simply kill the unfortunate requester, which may merely be
malloc'ing a 4k block...
This means that heavy code tweaking in the Tcl core might be a waste
in some OSes because anyway the kernel will take over before we can do
anything. No idea of the precise list though.
-Alex
.
- References:
- Tcl under conditions of high memory usage.
- From: neuronstorm@xxxxxxxxx
- Re: Tcl under conditions of high memory usage.
- From: Larry W. Virden
- Re: Tcl under conditions of high memory usage.
- From: billposer
- Re: Tcl under conditions of high memory usage.
- From: miguel
- Re: Tcl under conditions of high memory usage.
- From: neuronstorm@xxxxxxxxx
- Tcl under conditions of high memory usage.
- Prev by Date: Re: Passing literal strings to Tcl_Eval.
- Next by Date: Re: Using a tcl interpreter inside a DLL?
- Previous by thread: Re: Tcl under conditions of high memory usage.
- Next by thread: tclcurl examples please
- Index(es):
Relevant Pages
|