{"action":"created","issue":{"url":"https://api.github.com/repos/ropod7/pyboard_drive/issues/25","repository_url":"https://api.github.com/repos/ropod7/pyboard_drive","labels_url":"https://api.github.com/repos/ropod7/pyboard_drive/issues/25/labels{/name}","comments_url":"https://api.github.com/repos/ropod7/pyboard_drive/issues/25/comments","events_url":"https://api.github.com/repos/ropod7/pyboard_drive/issues/25/events","html_url":"https://github.com/ropod7/pyboard_drive/issues/25","id":148568415,"number":25,"title":"Driver memory consumption - measure object memory usage on the PyBoard","user":{"login":"mchobby","id":2701466,"avatar_url":"https://avatars.githubusercontent.com/u/2701466?v=3","gravatar_id":"","url":"https://api.github.com/users/mchobby","html_url":"https://github.com/mchobby","followers_url":"https://api.github.com/users/mchobby/followers","following_url":"https://api.github.com/users/mchobby/following{/other_user}","gists_url":"https://api.github.com/users/mchobby/gists{/gist_id}","starred_url":"https://api.github.com/users/mchobby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mchobby/subscriptions","organizations_url":"https://api.github.com/users/mchobby/orgs","repos_url":"https://api.github.com/users/mchobby/repos","events_url":"https://api.github.com/users/mchobby/events{/privacy}","received_events_url":"https://api.github.com/users/mchobby/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-15T06:43:16Z","updated_at":"2016-04-15T12:17:36Z","closed_at":null,"body":"Hi Roman, I did dig a bit into memory consumption on the PyBoard.\r\nI identified that register.py is eating as must memory than a font (1850 bytes).\r\nThere should be a way to spare RAM over there \r\n\r\n# How to mesure memory consumption\r\n```\r\n>>> import gc                                                                   \r\n>>> gc.collect()                                                                \r\n>>> b = gc.mem_free()                                                           \r\n>>> from registers import regs                                                  \r\n>>> gc.collect()                                                                \r\n>>> print( 'Mem consumption: %i' % (b - gc.mem_free()) )                        \r\nMem consumption: 1856 \r\n```\r\nSecond method (by looking the allocated memory\r\n```\r\n>>> import gc                                                                   \r\n>>> gc.collect()                                                                \r\n>>> b = gc.mem_alloc()                                                          \r\n>>> from registers import regs                                                  \r\n>>> gc.collect()                                                                                                             \r\n>>> print( gc.mem_alloc() - b )    \r\n1904\r\n```\r\n\r\n# Not possible to extend the PyBoard memory\r\nI did wonder if it would be possible to append some RAM module to the PyBoard (I would not be surprised of this, PyBoard is so powerfull).\r\n\r\nUnfortunately, it is not possible. Anyway, the thread was really interesting.\r\n* [PyBoard: is there a way to expand physical ram on Pyboard](http://forum.micropython.org/viewtopic.php?f=6&t=1770)\r\n# Resources\r\n\r\n* [french article](http://arduino103.blogspot.be/2016/04/micropython-pyboard-memoire-disponible.html)\r\n "},"comment":{"url":"https://api.github.com/repos/ropod7/pyboard_drive/issues/comments/210442905","html_url":"https://github.com/ropod7/pyboard_drive/issues/25#issuecomment-210442905","issue_url":"https://api.github.com/repos/ropod7/pyboard_drive/issues/25","id":210442905,"user":{"login":"ropod7","id":7129955,"avatar_url":"https://avatars.githubusercontent.com/u/7129955?v=3","gravatar_id":"","url":"https://api.github.com/users/ropod7","html_url":"https://github.com/ropod7","followers_url":"https://api.github.com/users/ropod7/followers","following_url":"https://api.github.com/users/ropod7/following{/other_user}","gists_url":"https://api.github.com/users/ropod7/gists{/gist_id}","starred_url":"https://api.github.com/users/ropod7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ropod7/subscriptions","organizations_url":"https://api.github.com/users/ropod7/orgs","repos_url":"https://api.github.com/users/ropod7/repos","events_url":"https://api.github.com/users/ropod7/events{/privacy}","received_events_url":"https://api.github.com/users/ropod7/received_events","type":"User","site_admin":false},"created_at":"2016-04-15T12:17:36Z","updated_at":"2016-04-15T12:17:36Z","body":"When using interrupts, pyboard use full stack, unreal to run a lot of processes, but we must to do it. It full of stack with interrupts, just using divides by floats."}}