{"action":"created","issue":{"url":"https://api.github.com/repos/3dmol/3Dmol.js/issues/367","repository_url":"https://api.github.com/repos/3dmol/3Dmol.js","labels_url":"https://api.github.com/repos/3dmol/3Dmol.js/issues/367/labels{/name}","comments_url":"https://api.github.com/repos/3dmol/3Dmol.js/issues/367/comments","events_url":"https://api.github.com/repos/3dmol/3Dmol.js/issues/367/events","html_url":"https://github.com/3dmol/3Dmol.js/issues/367","id":314125543,"number":367,"title":"1000+ unrendered spheres causes a memory spike, crashing Chrome tab","user":{"login":"dbryanbio","id":24845576,"avatar_url":"https://avatars2.githubusercontent.com/u/24845576?v=4","gravatar_id":"","url":"https://api.github.com/users/dbryanbio","html_url":"https://github.com/dbryanbio","followers_url":"https://api.github.com/users/dbryanbio/followers","following_url":"https://api.github.com/users/dbryanbio/following{/other_user}","gists_url":"https://api.github.com/users/dbryanbio/gists{/gist_id}","starred_url":"https://api.github.com/users/dbryanbio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbryanbio/subscriptions","organizations_url":"https://api.github.com/users/dbryanbio/orgs","repos_url":"https://api.github.com/users/dbryanbio/repos","events_url":"https://api.github.com/users/dbryanbio/events{/privacy}","received_events_url":"https://api.github.com/users/dbryanbio/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-04-13T14:18:22Z","updated_at":"2018-04-17T21:24:55Z","closed_at":null,"author_association":"NONE","body":"Process memory spikes to > 4G when adding 1000+ spheres, then subsides when rendering them. \r\nCrash a Chrome tab with 1022 unrendered spheres.\r\n\r\nTo reproduce:\r\nRename the attached files to 3Dmol.js (May 2017 release) and sphere-crash-repro.html, then view sphere-crash-repro.html in Chrome on Windows.  Click \"Add Spheres\" three times to crash the Chrome tab.  If you open up the Chrome Task Manager with Shift-Escape, you can watch the memory increasing and decreasing when you add spheres and render them.\r\n\r\nA successful way to add many spheres is to add and render in chunks of 500.\r\nMy environment is Windows 10, Dell XPS 15, 32G Ram.\r\n\r\n[3Dmol.txt](https://github.com/3dmol/3Dmol.js/files/1907635/3Dmol.txt)\r\n[sphere-crash-repro.txt](https://github.com/3dmol/3Dmol.js/files/1907636/sphere-crash-repro.txt)\r\n"},"comment":{"url":"https://api.github.com/repos/3dmol/3Dmol.js/issues/comments/382152156","html_url":"https://github.com/3dmol/3Dmol.js/issues/367#issuecomment-382152156","issue_url":"https://api.github.com/repos/3dmol/3Dmol.js/issues/367","id":382152156,"user":{"login":"dkoes","id":2342142,"avatar_url":"https://avatars2.githubusercontent.com/u/2342142?v=4","gravatar_id":"","url":"https://api.github.com/users/dkoes","html_url":"https://github.com/dkoes","followers_url":"https://api.github.com/users/dkoes/followers","following_url":"https://api.github.com/users/dkoes/following{/other_user}","gists_url":"https://api.github.com/users/dkoes/gists{/gist_id}","starred_url":"https://api.github.com/users/dkoes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dkoes/subscriptions","organizations_url":"https://api.github.com/users/dkoes/orgs","repos_url":"https://api.github.com/users/dkoes/repos","events_url":"https://api.github.com/users/dkoes/events{/privacy}","received_events_url":"https://api.github.com/users/dkoes/received_events","type":"User","site_admin":false},"created_at":"2018-04-17T21:24:55Z","updated_at":"2018-04-17T21:24:55Z","author_association":"CONTRIBUTOR","body":"I've pushed a fix (ee13fe0a7ac5bbb3f585ca85ea3c5e66f66a34d5) so spheres created through the GLViewer helper functions are more memory efficient.  If you are treating a bunch of shape primitives as one shape with shared material properties, creating a single GLShape and adding to that is the way to go.\r\n\r\nHowever, if all you want spheres with individual tooltips, your best bet is to create a molecule with a bunch of \"atoms\" rendered with a fixed radius.  As you can imagine, 3Dmol.js is optimized for rendering atoms.  They can all have their own hover callback (http://3dmol.csb.pitt.edu/tests/auto/generate_test.cgi?test=glviewer_js_setHoverable) and can have different, explicitly set, radii and colors."}}
{"actor":{"display_login":"dkoes"}}