{"action":"created","issue":{"url":"https://api.github.com/repos/RoumenDamianoff/laravel-sitemap/issues/82","labels_url":"https://api.github.com/repos/RoumenDamianoff/laravel-sitemap/issues/82/labels{/name}","comments_url":"https://api.github.com/repos/RoumenDamianoff/laravel-sitemap/issues/82/comments","events_url":"https://api.github.com/repos/RoumenDamianoff/laravel-sitemap/issues/82/events","html_url":"https://github.com/RoumenDamianoff/laravel-sitemap/issues/82","id":122653049,"number":82,"title":"Takes too much memory when we have to add like millions of links to the sitemap","user":{"login":"macpatel","id":5616105,"avatar_url":"https://avatars.githubusercontent.com/u/5616105?v=3","gravatar_id":"","url":"https://api.github.com/users/macpatel","html_url":"https://github.com/macpatel","followers_url":"https://api.github.com/users/macpatel/followers","following_url":"https://api.github.com/users/macpatel/following{/other_user}","gists_url":"https://api.github.com/users/macpatel/gists{/gist_id}","starred_url":"https://api.github.com/users/macpatel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/macpatel/subscriptions","organizations_url":"https://api.github.com/users/macpatel/orgs","repos_url":"https://api.github.com/users/macpatel/repos","events_url":"https://api.github.com/users/macpatel/events{/privacy}","received_events_url":"https://api.github.com/users/macpatel/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"RoumenDamianoff","id":1458253,"avatar_url":"https://avatars.githubusercontent.com/u/1458253?v=3","gravatar_id":"","url":"https://api.github.com/users/RoumenDamianoff","html_url":"https://github.com/RoumenDamianoff","followers_url":"https://api.github.com/users/RoumenDamianoff/followers","following_url":"https://api.github.com/users/RoumenDamianoff/following{/other_user}","gists_url":"https://api.github.com/users/RoumenDamianoff/gists{/gist_id}","starred_url":"https://api.github.com/users/RoumenDamianoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RoumenDamianoff/subscriptions","organizations_url":"https://api.github.com/users/RoumenDamianoff/orgs","repos_url":"https://api.github.com/users/RoumenDamianoff/repos","events_url":"https://api.github.com/users/RoumenDamianoff/events{/privacy}","received_events_url":"https://api.github.com/users/RoumenDamianoff/received_events","type":"User","site_admin":false},"milestone":null,"comments":4,"created_at":"2015-12-17T03:23:40Z","updated_at":"2015-12-18T05:12:25Z","closed_at":"2015-12-18T05:12:25Z","body":"It takes good amount of memory and time when we have like 1.5 Million links ,say from products and at the end of the loop we store it. which makes it take huge amount of memory and time before anything gets written to the disk.\r\n```PHP\r\n//Sample Code\r\n$product_sitemap = \\App::make(\"sitemap\");\r\nforeach ( $products in $products)\r\n{\r\n   $product_sitemap->add( route('site.product'), date('r'), 1.0, 'daily' );\r\n}\r\n$product_sitemap->store(''xml', 'sitemap-product'); //when the code is here all the links are in memory taking large amount of memory\r\n```\r\nThere should be some mechanism so that when ever the links are >50000 , it should flush all the links to disk in a sitemap.\r\n\r\nThanks,\r\nMahesh\r\n"},"comment":{"url":"https://api.github.com/repos/RoumenDamianoff/laravel-sitemap/issues/comments/165674739","html_url":"https://github.com/RoumenDamianoff/laravel-sitemap/issues/82#issuecomment-165674739","issue_url":"https://api.github.com/repos/RoumenDamianoff/laravel-sitemap/issues/82","id":165674739,"user":{"login":"macpatel","id":5616105,"avatar_url":"https://avatars.githubusercontent.com/u/5616105?v=3","gravatar_id":"","url":"https://api.github.com/users/macpatel","html_url":"https://github.com/macpatel","followers_url":"https://api.github.com/users/macpatel/followers","following_url":"https://api.github.com/users/macpatel/following{/other_user}","gists_url":"https://api.github.com/users/macpatel/gists{/gist_id}","starred_url":"https://api.github.com/users/macpatel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/macpatel/subscriptions","organizations_url":"https://api.github.com/users/macpatel/orgs","repos_url":"https://api.github.com/users/macpatel/repos","events_url":"https://api.github.com/users/macpatel/events{/privacy}","received_events_url":"https://api.github.com/users/macpatel/received_events","type":"User","site_admin":false},"created_at":"2015-12-18T05:12:25Z","updated_at":"2015-12-18T05:12:25Z","body":"Thanks!\r\nYes, I am using similar kind of solution. Just thought that it could be built in within the package.\r\n\r\nAnyways thanks for the example and taking time to answer my questions.\r\n"}}