memory allocation

Started by Dmi, August 03, 2005, 04:26:07 PM

Previous topic - Next topic

Dmi

I got a list about 6000 complex elements into memory
(set 'd (read-db "filename"))
and got 15M of memory allocated by newlisp.

then I transform "d" as follows:
(set 'd (convert-db d))
Finally I got about 2000 transformed (and reduced) items in d,

but newlisp allocates 30M now!

All code and executing was done in separate context. I save this context to be sure, that no lost symbols are there.

As I can see, following subsequent caslls to mentioned (convert-db) does not cause newlisp size growing - so allocated space is reused properly.



But can newlisp dynamically reduce the size it allocated? And when?
WBR, Dmi

Lutz

#1
It depends very much on the behaviour of the underlying OS. Sometimes newLISP gives memory back to the OS, but you will not see it in Window's taskmanager, then suddenly when another application needs more memory, the OS takes it. There is also some memory newLISP keeps in a 'free cell list' and reuses itself.



Lutz

Dmi

#2
Thanx!

What about Unix/Linux?

So, if I want to write a long-running daemon, that _sometimes_ gives much memory for processing - what will be it's "usual" memory usage? (possible resident and overall)
WBR, Dmi

Lutz

#3
This is hard to asses, it all depends on the mix of applications running. Linux/Unix seem to be more aggressive in paging out memory taken by an application but unused. At a client's site (kozoru.com) newLISP runs as inetd demons on about a 100 machines and without any memory leaks.



Lutz