Re: [AOLSERVER] are nsv_* functions freeing memory ?

2002-02-18 Thread Scott S. Goodwin

What does your module do? We can have it imported into the CVS tree at
sourceforge. Send it to me so I can take a look.

/s.

-+-+-+-+-+-+-+-+-+-+-+-+-
If to err is human, I must be more human than most.

Scott S. Goodwin
u: http://scottg.net
e: [EMAIL PROTECTED]
p: 850.897.6830
aim: scottgnet


- Original Message -
From: "Jean-Fabrice RABAUTE" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, February 18, 2002 4:36 PM
Subject: Re: are nsv_* functions freeing memory ?


> Hi,
>
> Thanks for all your replies.
> Scott S. Goodwin sent me a private email as well about the "high-water
mark" stuff.
> I thought the memory process was like that, but in this case my the server
should not grow (in memory) after 2 or 3 days (or very slowly). Anyway, the
process is still growing in memory even with my daily scheduled proc ! There
seems to be no impact with or without the sched. proc.
> Just for info, a lot of variables are "nsv_array", and I am using
"nsv_unset" on them. I checked the C source code, and nsv arrays should be
handled as well.
> I will check again my code to be sure I didn't forget some shared
variables. I don't think so, I used a standard "grep" to retrieve all my
nsv_ vars.
>
> In all cases, I will try to make more intensive and precise tests when I
get some time.
>
> Just another thing. I developed a little module for AOLServer, where can I
post it ?
>
> Best Regards.
>
> Jean-Fabrice RABAUTE.
> [EMAIL PROTECTED]
>



Re: [AOLSERVER] are nsv_* functions freeing memory ?

2002-02-18 Thread Jean-Fabrice RABAUTE

Hi,

Thanks for all your replies.
Scott S. Goodwin sent me a private email as well about the "high-water mark" stuff.
I thought the memory process was like that, but in this case my the server should not 
grow (in memory) after 2 or 3 days (or very slowly). Anyway, the process is still 
growing in memory even with my daily scheduled proc ! There seems to be no impact with 
or without the sched. proc.
Just for info, a lot of variables are "nsv_array", and I am using "nsv_unset" on them. 
I checked the C source code, and nsv arrays should be handled as well.
I will check again my code to be sure I didn't forget some shared variables. I don't 
think so, I used a standard "grep" to retrieve all my nsv_ vars.

In all cases, I will try to make more intensive and precise tests when I get some time.

Just another thing. I developed a little module for AOLServer, where can I post it ?

Best Regards.

Jean-Fabrice RABAUTE.
[EMAIL PROTECTED]



Re: [AOLSERVER] are nsv_* functions freeing memory ?

2002-02-18 Thread Jeffrey Hobbs

> +-- On Feb 18, Jean-Fabrice RABAUTE said:
> > There is no impact on the process memory ! It seems to not work at all.
>
> It won't release memory back to the OS; it just makes it available for
> nsd to use for other things again.

This is what's considered the "high-water mark" approach.  The allocator
is designed to allocate memory, but not free it (this is an allocator
dependent thing, but that's what the one that AOLServer uses).  The idea
is that if you allocated mem for 20MB worth of array elements, then you
will likely need that much again.  When you free those 20MB, they are
marked reusable in AOLServer though, so you should always see a
"high-water mark", rather than constantly increasing memory.

For those who worry about "but I only need 20MB once, and then 1MB all
the rest of the time", any decent OS with a good VM system (pretty much
all nowadays) will just swap those unused pages out anyway.

There are ways to change this behavior.  Tcl's built-in mem allocator
is a high-water mark allocator, but it was only used on Windows and
Mac (back when it was faster than their internal ones).  In 8.3.4 I
changed to use the system allocator on Windows, so it's no longer
high-water there.  AOLServer uses a special allocator to support
thread and obj allocation efficiently, but that could still be
modified (perhaps at a performance penalty).

In any case - I would like to hear more detail about Jean-Fabrice's
problem, because there shouldn't be a clear leak.

  Jeff Hobbs The Tcl Guy
  Senior Developer   http://www.ActiveState.com/



Re: [AOLSERVER] are nsv_* functions freeing memory ?

2002-02-18 Thread Rob Mayoff

+-- On Feb 18, Jean-Fabrice RABAUTE said:
> There is no impact on the process memory ! It seems to not work at all.

It won't release memory back to the OS; it just makes it available for
nsd to use for other things again.



Re: [AOLSERVER] are nsv_* functions freeing memory ?

2002-02-18 Thread Wojciech Kocjan

This does not make much sense.

I called these from nscp:

time {nsv_set a b c; nsv_unset a b} 100
for {set i 0} {$i<10} {incr i} {nsv_set a b$i c; nsv_unset a b$i}

Both of these resulted in nsd processes having the same number of memory
as before.

I hope this helps a bit :)

--
WK

Jean-Fabrice RABAUTE wrote:
> Hi eveybody,
>
> I am using extensively the nsv_* functions to save data in the memory for
> speed purpose (mainly saving big select results).
> It's working great.
> The only problem I have is that memory is growing indefinitely !
> So I created a daily schedule function to free the memory using the
> nsv_unset function.
> There is no impact on the process memory ! It seems to not work at all.
>
> Do you have any idea, if it's possible, on how to free shared memory ?
>
> Thanks for any tip.
>
> Best regards.
>
> Jean-Fabrice RABAUTE.
>
>
>
>



[AOLSERVER] are nsv_* functions freeing memory ?

2002-02-18 Thread Jean-Fabrice RABAUTE

Hi eveybody,

I am using extensively the nsv_* functions to save data in the memory for
speed purpose (mainly saving big select results).
It's working great.
The only problem I have is that memory is growing indefinitely !
So I created a daily schedule function to free the memory using the
nsv_unset function.
There is no impact on the process memory ! It seems to not work at all.

Do you have any idea, if it's possible, on how to free shared memory ?

Thanks for any tip.

Best regards.

Jean-Fabrice RABAUTE.