{"action":"created","issue":{"url":"https://api.github.com/repos/fent/node-ytdl-core/issues/323","repository_url":"https://api.github.com/repos/fent/node-ytdl-core","labels_url":"https://api.github.com/repos/fent/node-ytdl-core/issues/323/labels{/name}","comments_url":"https://api.github.com/repos/fent/node-ytdl-core/issues/323/comments","events_url":"https://api.github.com/repos/fent/node-ytdl-core/issues/323/events","html_url":"https://github.com/fent/node-ytdl-core/issues/323","id":326368487,"node_id":"MDU6SXNzdWUzMjYzNjg0ODc=","number":323,"title":"High RAM usage?","user":{"login":"FireController1847","id":16494272,"node_id":"MDQ6VXNlcjE2NDk0Mjcy","avatar_url":"https://avatars2.githubusercontent.com/u/16494272?v=4","gravatar_id":"","url":"https://api.github.com/users/FireController1847","html_url":"https://github.com/FireController1847","followers_url":"https://api.github.com/users/FireController1847/followers","following_url":"https://api.github.com/users/FireController1847/following{/other_user}","gists_url":"https://api.github.com/users/FireController1847/gists{/gist_id}","starred_url":"https://api.github.com/users/FireController1847/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FireController1847/subscriptions","organizations_url":"https://api.github.com/users/FireController1847/orgs","repos_url":"https://api.github.com/users/FireController1847/repos","events_url":"https://api.github.com/users/FireController1847/events{/privacy}","received_events_url":"https://api.github.com/users/FireController1847/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-05-25T03:28:07Z","updated_at":"2018-06-03T04:31:33Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"I don't see anyone else having this issue and it may be specific to my application, but I'm going to ask here just in case anyone else notices this aswell.\r\n\r\nWhen you \"stream\" directly from a YouTube URL, does it store said video in RAM instead of directly streaming it? I get that it pulls from YouTube faster than playback will play the video, but if it continually does that won't that build up in RAM?\r\n\r\nThis has never been an issue for me until about a month ago. I noticed that once I had increased playback buffer (because we had lag issues), RAM usage got worse. Before I could play ~20 videos at a time before hitting barley 4G. Now I can only do about ~12 before I hit 12G (the manual limit).\r\n\r\nHere's a test snippet if you guys would like to try it. This is untested so if I need to fix something lemme know:\r\n```js\r\nconst yt = require('ytdl-core');\r\n// Simulate a workload.\r\nconst videos = []; // Put 12-20 video links in here, make sure they're ~3 minute videos (songs). They can be longer but may give different results.\r\nconst streams = [];\r\nfor (let i = 0; i < videos.length; i++) {\r\n  streams.push(yt(videos[i], { quality: 'highestaudio' });\r\n}\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/fent/node-ytdl-core/issues/comments/394134342","html_url":"https://github.com/fent/node-ytdl-core/issues/323#issuecomment-394134342","issue_url":"https://api.github.com/repos/fent/node-ytdl-core/issues/323","id":394134342,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NDEzNDM0Mg==","user":{"login":"fent","id":933490,"node_id":"MDQ6VXNlcjkzMzQ5MA==","avatar_url":"https://avatars0.githubusercontent.com/u/933490?v=4","gravatar_id":"","url":"https://api.github.com/users/fent","html_url":"https://github.com/fent","followers_url":"https://api.github.com/users/fent/followers","following_url":"https://api.github.com/users/fent/following{/other_user}","gists_url":"https://api.github.com/users/fent/gists{/gist_id}","starred_url":"https://api.github.com/users/fent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fent/subscriptions","organizations_url":"https://api.github.com/users/fent/orgs","repos_url":"https://api.github.com/users/fent/repos","events_url":"https://api.github.com/users/fent/events{/privacy}","received_events_url":"https://api.github.com/users/fent/received_events","type":"User","site_admin":false},"created_at":"2018-06-03T04:31:33Z","updated_at":"2018-06-03T04:31:33Z","author_association":"OWNER","body":"> I guess what I don't understand is, when the data in memory has been consumed is it removed?\r\n\r\nYes\r\n\r\n> Then, I tested out the 'highWaterMark' option and the 'highestaudio' option instead of 'audioonly'. Could the cause of this not be related to 'highWaterMark' and instead be an issue with 'highestaudio' vs 'audioonly'?\r\n\r\n`highestaudio` does have much larger files, since often, they will also include a video. But even so, it should only be downloading as much as it needs, as it's being consumed by your bot. It does sound like there's a problem somewhere, but I'm not sure where."}}
{"actor":{"display_login":"fent"}}