Giter VIP home page Giter VIP logo

lua-snapshot's Introduction

lua-snapshot

Make a snapshot for lua state to detect memory leaks.

See dump.lua for example.

Build

make linux

or

make mingw (in windows)

or

make macosx

lua-snapshot's People

Contributors

cloudwu avatar kenmacd avatar lvzixun avatar m2q1n9 avatar spin6lock avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lua-snapshot's Issues

Lua 5.1 Support?

Is there any chance you could back-port this to Lua 5.1? There are still many of us that are stuck at the older version for one reason or another. I tried a quick hack at the code but it appears the snapshot doesn't pick up variables marked as "local".

Thanks . . .

unable to detect coroutine upvalue leak

example code(test.lua):

local snapshot = require "snapshot"

local function create_co()
    local co_upvalue = { 1,2,3 }
    local co = coroutine.create( function()
        for k,v in pairs( co_upvalue ) do
            print( k,v )
        end
    end )
    return co
end

local S1 = snapshot()

co = create_co()

local S2 = snapshot()

for k,v in pairs(S2) do
    if S1[k] == nil then
        print(k,v)
    end
end

coroutine.resume( co ) -- test,co_upvalue still in memory

output:

lua test.lua
userdata: 0x10be3e8	
0x10ba930 : co

userdata: 0x10c9210	table
0x10ba018 : S1 : test.lua:17

1	1
2	2
3	3

no leak infomation about co_upvalue ?

使用pbc时为什么会有内存泄漏?

    local req_name = "ZoneProtocol.GetSceneItemListReq"
    local S1 = snapshot()
    pb.encode(req_name, {sceneid=0})
    local S2 = snapshot()
    for k,v in pairs(S2) do
      if S1[k] == nil then
        print(k,v)
      end
    end

输出:
userdata: 0x7f0b21083cc0 table
0x7f0b1fc8b708 : S1 : ...iao/rp_server/pub/test_robot/bin/service/robot_agent.lua:146

userdata: 0x7f0b2101c040 table
0x7f0b1fca2dc0 : ZoneProtocol.GetSceneItemListReq

What License is this released under?

Could you drop a license file into this project that mentions how this project is licensed. I hope it's a MIT or BSD-flavored license . . . this would make it easier to work with.

Thanks . . .

执行lua dump.lua出现Segmentation fault

你好:
我将文件包下载解压后,在centos 7上编译成功,然后直接执行lua dump.lua,出现段错误,没有仔细研究过lua,请问一下是什么原因呢,lua版本是5.1.4

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.