{"action":"created","issue":{"url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/40","labels_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/40/labels{/name}","comments_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/40/comments","events_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/40/events","html_url":"https://github.com/nodemcu/nodemcu-firmware/issues/40","id":52657452,"number":40,"title":"Decreasing Heap size","user":{"login":"paulcuth","id":132676,"avatar_url":"https://avatars.githubusercontent.com/u/132676?v=3","gravatar_id":"","url":"https://api.github.com/users/paulcuth","html_url":"https://github.com/paulcuth","followers_url":"https://api.github.com/users/paulcuth/followers","following_url":"https://api.github.com/users/paulcuth/following{/other_user}","gists_url":"https://api.github.com/users/paulcuth/gists{/gist_id}","starred_url":"https://api.github.com/users/paulcuth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulcuth/subscriptions","organizations_url":"https://api.github.com/users/paulcuth/orgs","repos_url":"https://api.github.com/users/paulcuth/repos","events_url":"https://api.github.com/users/paulcuth/events{/privacy}","received_events_url":"https://api.github.com/users/paulcuth/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2014-12-22T15:10:37Z","updated_at":"2015-08-21T09:49:10Z","closed_at":"2015-08-21T09:49:10Z","body":"Hi,\r\n\r\nFirstly, thanks for the great work, not only in creating this project, but also for your responsive updates and fixes. The modules, together with this project, are very exciting indeed.\r\n\r\nHowever, one thing concerns me; I've noticed that as the updates keep coming and the API grows, the heap available to our Lua scripts is decreasing. I noted that, in the first two weeks in December, the available heap dropped by 6% and the updates have kept coming since. Am I correct in assuming that this is a result of the firmware expanding?\r\n\r\nIf so, is there any way that the API namespaces (for example `ow`, `gpio`, `i2c`) can start unloaded and are only loaded when `require()` is called? That way, libraries that I'm not using won't take up valuable heap space that my scripts could be using.\r\n\r\nFor example:\r\n```lua\r\nprint(gpio)   --> nil\r\nlocal gpio = require 'gpio'\r\nprint(gpio)   --> table\r\ngpio.mode(9, gpio.OUTPUT)\r\n-- etc\r\n```\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/comments/133357270","html_url":"https://github.com/nodemcu/nodemcu-firmware/issues/40#issuecomment-133357270","issue_url":"https://api.github.com/repos/nodemcu/nodemcu-firmware/issues/40","id":133357270,"user":{"login":"TerryE","id":690173,"avatar_url":"https://avatars.githubusercontent.com/u/690173?v=3","gravatar_id":"","url":"https://api.github.com/users/TerryE","html_url":"https://github.com/TerryE","followers_url":"https://api.github.com/users/TerryE/followers","following_url":"https://api.github.com/users/TerryE/following{/other_user}","gists_url":"https://api.github.com/users/TerryE/gists{/gist_id}","starred_url":"https://api.github.com/users/TerryE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TerryE/subscriptions","organizations_url":"https://api.github.com/users/TerryE/orgs","repos_url":"https://api.github.com/users/TerryE/repos","events_url":"https://api.github.com/users/TerryE/events{/privacy}","received_events_url":"https://api.github.com/users/TerryE/received_events","type":"User","site_admin":false},"created_at":"2015-08-21T09:49:10Z","updated_at":"2015-08-21T09:49:10Z","body":"Inactive debate, which has largely been addressed by recent improvements."}}