wifi.sta.getap(function(t)
config.ListAP(t)
collectgarbage()
end)
The collect inside the function doesn't do much, because it can't collect the running function... Maybe you are just not collecting at the right time.
If that doesn't work, I'll try it myself when I get in from church tonight.