collectgarbage question.

View: New views
4 Messages — Rating Filter:   Alert me  

collectgarbage question.

by Taesoo Kwon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I am using luabind-0.8.1, lua 5.1.4, and VC2005.
I have a strange bug; collect garbage doesn't work in the following simple code.

-----------------------------------------------------------------------
test1.lua -> Garbage collection doesn't work. (the dtor of VRMLloader class is not called.)

   do
      local skel=VRMLloader("aa.wrl")
      skel.dofInfo:setFrameRate(30)
   end
   collectgarbage()

-----------------------------------------------------------------------
test2.lua -> Garbage collection works. (dtor called)

   do
      local skel=VRMLloader("aa.wrl")
   end
   collectgarbage()

I have no idea what could cause the difference. Has anybody observed similar situation?

-----------------------------------------------------------------------
binding:

class VRMLloader: public MotionLoader
{
public:
    MotionDOFinfo dofInfo;

    VRMLloader(const char* vrmlFile);
    virtual ~VRMLloader() { printf("dtor called");}
   ...
};   

    luabind::class_<VRMLloader, MotionLoader>("VRMLloader")
            .def_readwrite("dofInfo", &VRMLloader::dofInfo)
            .def(luabind::constructor<const char*>())



Thanks.

------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
luabind-user mailing list
luabind-user@...
https://lists.sourceforge.net/lists/listinfo/luabind-user

Re: collectgarbage question.

by Taesoo Kwon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I am sorry. This wasn't a bug but a feature of lua 5.1.4.
I had to add one more collectgarbage() call.

do
      local skel=VRMLloader("aa.wrl")
      skel.dofInfo:setFrameRate(30)
end

collectgarbage()
collectgarbage() -- two cycles are needed.



On Wed, Sep 23, 2009 at 4:36 PM, Taesoo Kwon <taesoobear@...> wrote:
Hi,

I am using luabind-0.8.1, lua 5.1.4, and VC2005.
I have a strange bug; collect garbage doesn't work in the following simple code.

-----------------------------------------------------------------------
test1.lua -> Garbage collection doesn't work. (the dtor of VRMLloader class is not called.)

   do
      local skel=VRMLloader("aa.wrl")
      skel.dofInfo:setFrameRate(30)
   end
   collectgarbage()

-----------------------------------------------------------------------
test2.lua -> Garbage collection works. (dtor called)

   do
      local skel=VRMLloader("aa.wrl")
   end
   collectgarbage()

I have no idea what could cause the difference. Has anybody observed similar situation?

-----------------------------------------------------------------------
binding:

class VRMLloader: public MotionLoader
{
public:
    MotionDOFinfo dofInfo;

    VRMLloader(const char* vrmlFile);
    virtual ~VRMLloader() { printf("dtor called");}
   ...
};   

    luabind::class_<VRMLloader, MotionLoader>("VRMLloader")
            .def_readwrite("dofInfo", &VRMLloader::dofInfo)
            .def(luabind::constructor<const char*>())



Thanks.


------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
luabind-user mailing list
luabind-user@...
https://lists.sourceforge.net/lists/listinfo/luabind-user

Re: collectgarbage question.

by Tony Kostanjsek :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
have you tried collectgarbage("collect") to perform a full garbage collection cycle? I'm not even sure what it does without an argument: http://www.lua.org/manual/5.1/manual.html


Von: Taesoo Kwon <taesoobear@...>
An: luabind-user@...
Gesendet: Mittwoch, den 23. September 2009, 23:04:16 Uhr
Betreff: Re: [luabind] collectgarbage question.

I am sorry. This wasn't a bug but a feature of lua 5.1.4.
I had to add one more collectgarbage() call.

do
      local skel=VRMLloader("aa.wrl")
      skel.dofInfo:setFrameRate(30)
end

collectgarbage()
collectgarbage() -- two cycles are needed.



On Wed, Sep 23, 2009 at 4:36 PM, Taesoo Kwon <taesoobear@...> wrote:
Hi,

I am using luabind-0.8.1, lua 5.1.4, and VC2005.
I have a strange bug; collect garbage doesn't work in the following simple code.

-----------------------------------------------------------------------
test1.lua -> Garbage collection doesn't work. (the dtor of VRMLloader class is not called.)

   do
      local skel=VRMLloader("aa.wrl")
      skel.dofInfo:setFrameRate(30)
   end
   collectgarbage()

-----------------------------------------------------------------------
test2.lua -> Garbage collection works. (dtor called)

   do
      local skel=VRMLloader("aa.wrl")
   end
   collectgarbage()

I have no idea what could cause the difference. Has anybody observed similar situation?

-----------------------------------------------------------------------
binding:

class VRMLloader: public MotionLoader
{
public:
    MotionDOFinfo dofInfo;

    VRMLloader(const char* vrmlFile);
    virtual ~VRMLloader() { printf("dtor called");}
   ...
};   

    luabind::class_<VRMLloader, MotionLoader>("VRMLloader")
            .def_readwrite("dofInfo", &VRMLloader::dofInfo)
            .def(luabind::constructor<const char*>())



Thanks.



------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
luabind-user mailing list
luabind-user@...
https://lists.sourceforge.net/lists/listinfo/luabind-user

Re: collectgarbage question.

by Taesoo Kwon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yes, I have. It gave the same result.
A single collectgarbage call was not effective using any of the options.
So I thought this may be what they call incremental garbage collection.

On Wed, Sep 23, 2009 at 6:27 PM, Tony Kostanjsek <lobotony666@...> wrote:
have you tried collectgarbage("collect") to perform a full garbage collection cycle? I'm not even sure what it does without an argument: http://www.lua.org/manual/5.1/manual.html


Von: Taesoo Kwon <taesoobear@...>
An: luabind-user@...
Gesendet: Mittwoch, den 23. September 2009, 23:04:16 Uhr
Betreff: Re: [luabind] collectgarbage question.

I am sorry. This wasn't a bug but a feature of lua 5.1.4.
I had to add one more collectgarbage() call.

do
      local skel=VRMLloader("aa.wrl")
      skel.dofInfo:setFrameRate(30)
end

collectgarbage()
collectgarbage() -- two cycles are needed.



On Wed, Sep 23, 2009 at 4:36 PM, Taesoo Kwon <taesoobear@...> wrote:
Hi,

I am using luabind-0.8.1, lua 5.1.4, and VC2005.
I have a strange bug; collect garbage doesn't work in the following simple code.

-----------------------------------------------------------------------
test1.lua -> Garbage collection doesn't work. (the dtor of VRMLloader class is not called.)

   do
      local skel=VRMLloader("aa.wrl")
      skel.dofInfo:setFrameRate(30)
   end
   collectgarbage()

-----------------------------------------------------------------------
test2.lua -> Garbage collection works. (dtor called)

   do
      local skel=VRMLloader("aa.wrl")
   end
   collectgarbage()

I have no idea what could cause the difference. Has anybody observed similar situation?

-----------------------------------------------------------------------
binding:

class VRMLloader: public MotionLoader
{
public:
    MotionDOFinfo dofInfo;

    VRMLloader(const char* vrmlFile);
    virtual ~VRMLloader() { printf("dtor called");}
   ...
};   

    luabind::class_<VRMLloader, MotionLoader>("VRMLloader")
            .def_readwrite("dofInfo", &VRMLloader::dofInfo)
            .def(luabind::constructor<const char*>())



Thanks.



------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
luabind-user mailing list
luabind-user@...
https://lists.sourceforge.net/lists/listinfo/luabind-user



------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
luabind-user mailing list
luabind-user@...
https://lists.sourceforge.net/lists/listinfo/luabind-user