-
Notifications
You must be signed in to change notification settings - Fork 36
Closed
Description
Hi,不知道是不是调用的方式不对,查询的时候内存会一直不断增长。
下面是我写的脚本,可以重现。
环境是:CentOS 7.5.1804, openresty/1.13.6.2
-- test.lua
local geoip = require("resty.maxminddb").new("/usr/local/share/GeoIP/GeoLite2-Country.mmdb")
for i = 1, 200000 do
local ip = string.format("%s.%s.%s.%s", math.random(1, 255), math.random(1, 255), math.random(1, 255), math.random(1, 255))
local res, err = geoip:lookup(ip)
if res and res.country and res.country.iso_code then
print(i, res.country.iso_code)
end
end
$ resty test.lua
Metadata
Metadata
Assignees
Labels
No labels