newbie questions

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

newbie questions

Max Ischenko
1. Is there profiling tool to check Lua memory footprint?
2. I have built Lua 4.0 and can't get to work tools from
  add-ons homepage (tklua for example). Problem is 
  probably that tklua uses old Lua API which is not compatible with v4.
  I get lua3.tgz and change tklua.h accordingly but this didn't help.


-- 
If you can't explain something to a six-year-old, you really don't
understand it yourself. 
		-- Albert Einstein

Reply | Threaded
Open this post in threaded view
|

Re: newbie questions

Luiz Henrique de Figueiredo
>1. Is there profiling tool to check Lua memory footprint?

No tool, except "ps" in Unix.
But you can try recompiling lmem.c with LUA_DEBUG defined and then print

 memdebug_numblocks
 memdebug_total
 memdebug_maxmem
 memdebug_memlimit

>2. I have built Lua 4.0 and can't get to work tools from
>  add-ons homepage (tklua for example). Problem is 
>  probably that tklua uses old Lua API which is not compatible with v4.
>  I get lua3.tgz and change tklua.h accordingly but this didn't help.

Are you using the new verions of tolua: tolua-4.0a.tar.gz?
This should work with Lua 4.0.
--lhf

Reply | Threaded
Open this post in threaded view
|

Re: newbie questions

Waldemar Celes-3
> >2. I have built Lua 4.0 and can't get to work tools from
> >  add-ons homepage (tklua for example). Problem is
> >  probably that tklua uses old Lua API which is not compatible with v4.
> >  I get lua3.tgz and change tklua.h accordingly but this didn't help.
>
> Are you using the new verions of tolua: tolua-4.0a.tar.gz?
> This should work with Lua 4.0.

No. tklua uses pre-compiled code and needs to be updated to lua4.0.
I can try to do it as soon as I have a spare time (probably next week).

-- waldemar


Reply | Threaded
Open this post in threaded view
|

Re: newbie questions

Max Ischenko
In reply to this post by Luiz Henrique de Figueiredo
	Hi there, Luiz Henrique de Figueiredo!
	On Tuesday, 12 of December you wrote:

> >1. Is there profiling tool to check Lua memory footprint?
> 
> No tool, except "ps" in Unix.
> But you can try recompiling lmem.c with LUA_DEBUG defined and then print
> 
>  memdebug_numblocks
>  memdebug_total
>  memdebug_maxmem
>  memdebug_memlimit

Tnx, it works.
More precisely, after compiling with LUA_DEBUG
T.totalmem() and such available to Lua.


-- 
Best regards, Maxim F. Ischenko.

Reply | Threaded
Open this post in threaded view
|

Re: newbie questions

Steve Dekorte-4
In reply to this post by Max Ischenko
Max Ischenko wrote:
> > >1. Is there profiling tool to check Lua memory footprint? 

We added an api to lua to do this in yindo. It would be nice to have an
api like this as part of lua.

Steve

Reply | Threaded
Open this post in threaded view
|

Re: newbie questions

Roberto Ierusalimschy
> > >1. Is there profiling tool to check Lua memory footprint? 

Lua 4.0 has a new function `gcinfo'. Its first return is the current
memory usage of Lua. This value is a lower bound, usually within 5% of
the real value, and is expressed in Kbytes.

  > lua -e "print(gcinfo())"
  22	27

(the second result it the current threshold for GC).

(Unfortunately, this function did not find its way into the manual ;-)

-- Roberto

Reply | Threaded
Open this post in threaded view
|

Re: newbie questions

Reuben Thomas-3
On Wed, 13 Dec 2000, Roberto Ierusalimschy wrote:

> (Unfortunately, this function did not find its way into the manual ;-)

But it will now, right?

-- 
http://sc3d.org/rrt/
L'art des vers est de transformer en beautés les faiblesses (Aragon)