Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go Memory leak #44

Open
zhaowolong opened this issue Nov 8, 2017 · 4 comments
Open

go Memory leak #44

zhaowolong opened this issue Nov 8, 2017 · 4 comments

Comments

@zhaowolong
Copy link

when i use luar in my project, i find the memory leak. i find the memery in lua collectgarbage("count") is normal, bug the process is not gc

@zhaowolong
Copy link
Author

function test()
9 if math.random(1, 10) == 1 then
8 local s1 = table.clone(TableFishAdd)
7 local b1 = table.clone(TableFishPath)
6 unilight.info("1 table.clone,size" .. collectgarbage("count"))
5 local s2 = table.clone(TableFishAdd)
4 local s2 = table.clone(TableFishAdd)
3 unilight.info("2 table.clone,size" .. collectgarbage("count"))
2 local b3 = table.clone(TableFishPath)
1 local b3 = table.clone(TableFishPath)
30

@zhaowolong
Copy link
Author

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
15697 ubuntu 20 0 4031m 3.0g 8540 S 3 19.4 2:08.28 server

@zhaowolong
Copy link
Author

[171108-16:30:46] INFO 1 table.clone,size316179.98828125
[171108-16:30:46] INFO 2 table.clone,size460031.12988281
[171108-16:30:46] INFO 3before table.clone,size467660.14648438
[171108-16:30:46] INFO 3end table.clone,size0
[171108-16:30:56] INFO 1 table.clone,size316215.05859375
[171108-16:30:56] INFO 2 table.clone,size460066.20019531
[171108-16:30:56] INFO 3before table.clone,size467695.21679688
[171108-16:30:56] INFO 3end table.clone,size0
[171108-16:30:59] INFO 1 table.clone,size316204.9765625
[171108-16:30:59] INFO 2 table.clone,size460056.11621094
[171108-16:30:59] INFO 3before table.clone,size467685.1328125
[171108-16:30:59] INFO 3end table.clone,size0
[171108-16:31:36] INFO 1 table.clone,size316345.5859375
[171108-16:31:36] INFO 2 table.clone,size460196.72558594
[171108-16:31:36] INFO 3before table.clone,size467825.7421875

@Ambrevar
Copy link
Collaborator

Sorry for the long delay, I've got little time to work on Luar these days.
I'll come back to it later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants