Re: Tcl under conditions of high memory usage.



On Nov 30, 12:49 am, miguel <mso...@xxxxxxxxxxxx> wrote:
billpo...@xxxxxxxxxxxx wrote:
On Nov 29, 8:50 am, "Larry W. Virden" <lvir...@xxxxxxxxx> wrote:
What are some alternatives that the language might take in this case?

If doing something other than aborting on inability to get more memory
is important, one could use a memory manager that kept track of how
much memory it had left and sent an alert (in the case of tcl, I
suppose an event would be the most useful) when it got down to a
certain level. The event-handler could then take appropriate clean-up
action before shutting down, or, conceivably, free enough memory to
continue.

This is only possible, however, if the interpreter pre-allocates a
chunk of memory to work with - otherwise there is no way to know how
much is left. If it uses as the measure of "how much is left" what is
left in the system, it will be unreliable as another process may
acquire it in the meantime. An attempt to expand the arena could of
course be one of the actions attempted by the event-handler.

The general situation is indeed as bad as you describe it.

What we could do (as an example) is: when the user requests
lappend x $foo
if the system cannot alloc enough memory to perform the command, just
return an error. Now it panics.

As I said - it is not a small change. I guess we will get around to
doing that eventually.- Hide quoted text -

- Show quoted text -


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,
so I'm not really understanding why you would want Tcl apps to crash
or produce an error.

J
.



Relevant Pages

  • Re: Microsoft Word wont load on my iMac G4 after kernel panic
    ... that it is hardware related, but I've found that an archive and install ... fixes it for about another 6 mos to a year (and they the panics return). ... reported there was 6 weeks ago, and said there was a memory exception ... /Library/Logs contains your panic reports. ...
    (microsoft.public.mac.office.word)
  • Re: Are there any plan to fix the memory leaks in TCL?
    ... The memory leak is present in 8.3 and 8.4 on all platforms. ... >Tcl, as well as the purify report (please attach it as a file, do not ... The Tcl maintainers take memory hygiene *very* ... and only reflect respect for the gravity of your report. ...
    (comp.lang.tcl)
  • Re: Large mem disk with not very recent current
    ... But system panics while I try to extract source tree. ... > So now I am in stage of adaptation to/setting up remote debugging. ... Try using swap backing instead of malloc. ... Malloc will consume wired memory and will generally make life difficult ...
    (freebsd-current)
  • Re: ZFS crashes on heavy threaded environment
    ... The setup is so that one zfs filesystem is mounted into a jail handling ... Cannot allocate memory. ... I experienced several panics upon shutdown. ... Memory allocation failed:: Cannot allocate memory ...
    (freebsd-stable)
  • Re: Memory used by tcl script
    ... Gerald W. Lester wrote: ... >> It seems to me as if the amount of allocated mEmory stays on the level ... Tcl does its own memory management and does not ... many don't like the high-water-mark facets of such allocators. ...
    (comp.lang.tcl)