[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lua-l
Subject:    Re: Table memory usage
From:       Roberto Ierusalimschy <roberto () inf ! puc-rio ! br>
Date:       2005-02-28 14:11:59
Message-ID: 20050228141159.AEFEBA04E9 () arraial ! inf ! puc-rio ! br
[Download RAW message or body]

> is it possible to find the memory usage of a table?

No.


> I assume in low memory situations, the Lua interpreter would throw an
> error when it ran out of memory? (sure other things would grind to a
> halt as well!) I would much rather have the script throw the error and
> have some chance of exiting gracefully.

Low memory situations generate the same kind of error as an error
thrown by the script, except that it does not generate a traceback.
You can catch it as you catch other errors (e.g., with pcall).
Of course, you must be careful not to require more memory to handle
it, or Lua may rethrow the error...

-- Roberto

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic