meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Last revisionBoth sides next revision
home_automation:esp8266:nodemcu [2016/12/28 13:32] – [Other Projects] niziakhome_automation:esp8266:nodemcu [2016/12/29 21:35] niziak
Line 28: Line 28:
  
   * Current API: [[https://github.com/nodemcu/nodemcu-firmware/wiki/nodemcu_api_en]]   * Current API: [[https://github.com/nodemcu/nodemcu-firmware/wiki/nodemcu_api_en]]
 +
 +===== Saving memory =====
 +  * Avoid upvalues for context passed between event callbacks, as its very difficulat to get a handle on memory leaks created by these. Only use globals for this usecase.
 +  * Nil globals once they are no longer needed so that they can be properly GCed.
 +  * Allocate resources and create closures on a just-in-time basis.
 +  * The cost of require or dofile is relatively small, so break your program into overlays one per event and use a small stub function as a callback to load each.
 +    * Use compiled .lc files and load using dofile().
  
 ===== Scan WiFi ===== ===== Scan WiFi =====