{"action":"created","issue":{"url":"https://api.github.com/repos/101100/pca9685/issues/1","labels_url":"https://api.github.com/repos/101100/pca9685/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/101100/pca9685/issues/1/comments","events_url":"https://api.github.com/repos/101100/pca9685/issues/1/events","html_url":"https://github.com/101100/pca9685/pull/1","id":108545091,"number":1,"title":"Memory leak in setPulseRange","user":{"login":"tacoe","id":132443,"avatar_url":"https://avatars.githubusercontent.com/u/132443?v=3","gravatar_id":"","url":"https://api.github.com/users/tacoe","html_url":"https://github.com/tacoe","followers_url":"https://api.github.com/users/tacoe/followers","following_url":"https://api.github.com/users/tacoe/following{/other_user}","gists_url":"https://api.github.com/users/tacoe/gists{/gist_id}","starred_url":"https://api.github.com/users/tacoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tacoe/subscriptions","organizations_url":"https://api.github.com/users/tacoe/orgs","repos_url":"https://api.github.com/users/tacoe/repos","events_url":"https://api.github.com/users/tacoe/events{/privacy}","received_events_url":"https://api.github.com/users/tacoe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-27T16:08:09Z","updated_at":"2015-10-21T20:15:38Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/101100/pca9685/pulls/1","html_url":"https://github.com/101100/pca9685/pull/1","diff_url":"https://github.com/101100/pca9685/pull/1.diff","patch_url":"https://github.com/101100/pca9685/pull/1.patch"},"body":"I have a node script that uses two PCA9658 banks to control LED strips, 30 channels in total. Those update as fluently(=frequently) as possible, which is about 25fps on a raspberry pi, given an increased I2C baudrate of 400Kbps. These 750 calls/second to set PWM width cause node to become unresponsive within minutes, as it burns through memory. I've been able to isolate the leak down to the setPulseRange on the pwm object.\r\n\r\nI noticed that this lib check/converts the input to an array (in _send) after which the i2c lib checks/converts it to a buffer (in writeBytes). Could either of those cause a leak?\r\n"},"comment":{"url":"https://api.github.com/repos/101100/pca9685/issues/comments/150012396","html_url":"https://github.com/101100/pca9685/pull/1#issuecomment-150012396","issue_url":"https://api.github.com/repos/101100/pca9685/issues/1","id":150012396,"user":{"login":"tacoe","id":132443,"avatar_url":"https://avatars.githubusercontent.com/u/132443?v=3","gravatar_id":"","url":"https://api.github.com/users/tacoe","html_url":"https://github.com/tacoe","followers_url":"https://api.github.com/users/tacoe/followers","following_url":"https://api.github.com/users/tacoe/following{/other_user}","gists_url":"https://api.github.com/users/tacoe/gists{/gist_id}","starred_url":"https://api.github.com/users/tacoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tacoe/subscriptions","organizations_url":"https://api.github.com/users/tacoe/orgs","repos_url":"https://api.github.com/users/tacoe/repos","events_url":"https://api.github.com/users/tacoe/events{/privacy}","received_events_url":"https://api.github.com/users/tacoe/received_events","type":"User","site_admin":false},"created_at":"2015-10-21T20:15:38Z","updated_at":"2015-10-21T20:15:38Z","body":"Hey thanks jason! I was diving into the i2c lib itself and noticed the issue there as well, seems pca9685 is not the culprit at all. (Sorry I haven't been helpful in testing the branch—I've since switched to full python for driving the PWMs and hosting that within node for high level control. much faster too, for some reason)"}}