{"action":"created","issue":{"url":"https://api.github.com/repos/infinispan/infinispan/issues/3342","labels_url":"https://api.github.com/repos/infinispan/infinispan/issues/3342/labels{/name}","comments_url":"https://api.github.com/repos/infinispan/infinispan/issues/3342/comments","events_url":"https://api.github.com/repos/infinispan/infinispan/issues/3342/events","html_url":"https://github.com/infinispan/infinispan/pull/3342","id":64469525,"number":3342,"title":"ISPN-5329 Reduce number of allocations","user":{"login":"rvansa","id":2167869,"avatar_url":"https://avatars.githubusercontent.com/u/2167869?v=3","gravatar_id":"","url":"https://api.github.com/users/rvansa","html_url":"https://github.com/rvansa","followers_url":"https://api.github.com/users/rvansa/followers","following_url":"https://api.github.com/users/rvansa/following{/other_user}","gists_url":"https://api.github.com/users/rvansa/gists{/gist_id}","starred_url":"https://api.github.com/users/rvansa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rvansa/subscriptions","organizations_url":"https://api.github.com/users/rvansa/orgs","repos_url":"https://api.github.com/users/rvansa/repos","events_url":"https://api.github.com/users/rvansa/events{/privacy}","received_events_url":"https://api.github.com/users/rvansa/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/infinispan/infinispan/labels/Ready%20for%20Review","name":"Ready for Review","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-03-26T08:33:53Z","updated_at":"2015-04-03T21:48:23Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/infinispan/infinispan/pulls/3342","html_url":"https://github.com/infinispan/infinispan/pull/3342","diff_url":"https://github.com/infinispan/infinispan/pull/3342.diff","patch_url":"https://github.com/infinispan/infinispan/pull/3342.patch"},"body":"I have analyzed allocations during put() (into local cache) and removed some of the low-hanging fruits. Some of those could be already handled by escape analysis, but most of them cannot, IMO. Though, the difference between performance before and after was within the margin of error of the benchmark. \r\n\r\nYou can find both the benchmark and Byteman tooling for analysis at https://github.com/rvansa/benchmarks/tree/master/ispntest"},"comment":{"url":"https://api.github.com/repos/infinispan/infinispan/issues/comments/89430015","html_url":"https://github.com/infinispan/infinispan/pull/3342#issuecomment-89430015","issue_url":"https://api.github.com/repos/infinispan/infinispan/issues/3342","id":89430015,"user":{"login":"Sanne","id":42573,"avatar_url":"https://avatars.githubusercontent.com/u/42573?v=3","gravatar_id":"","url":"https://api.github.com/users/Sanne","html_url":"https://github.com/Sanne","followers_url":"https://api.github.com/users/Sanne/followers","following_url":"https://api.github.com/users/Sanne/following{/other_user}","gists_url":"https://api.github.com/users/Sanne/gists{/gist_id}","starred_url":"https://api.github.com/users/Sanne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sanne/subscriptions","organizations_url":"https://api.github.com/users/Sanne/orgs","repos_url":"https://api.github.com/users/Sanne/repos","events_url":"https://api.github.com/users/Sanne/events{/privacy}","received_events_url":"https://api.github.com/users/Sanne/received_events","type":"User","site_admin":false},"created_at":"2015-04-03T21:48:23Z","updated_at":"2015-04-03T21:48:23Z","body":"Great initiative :+1: \r\n\r\nDan, asking to measure results as direct performance impact is very hard. All we know is that in a full system (which does many other things and runs lots of user code too) you'll *generally* end up in trouble with memory because of Infinispan using it all/most up for himself.\r\nYou might not be able to measure this at all by just measuring Infinispan; the problem is crossing the threshold of how much is sensible to allocate in terms of temporary objects. As long as you don't cross the threshold, it might look like (almost) free to allocate some temporary helpers, so like making a defensive copy of a Map might look like \"free\". But when doing such things extensively, the system falls over.\r\n\r\nAt that point the memory bandwidth is saturated, and the CPU will be mostly sitting idle. Ironically, that means that making some code less efficient will not be measured by any benchmark either, as you'll be putting to better use some CPU cycles which are otherwise wasted in idle waits for main memory, or worse trigger additional context switching exacerbating the problem of *unpredictable* performance per operation.\r\n\r\nIt's measurable that there is such a problem of excess heap utilization as it's pretty easy to cross all these boundaries even when using Infinispan with a pretty well written client application. The solution is to keep working on these patches, however we'll need many of these before any difference can be measured.\r\n\r\nThat said, @rvansa make sure you don't focus just on instance numbers but prioritize based on size of instances? I'm not sure how you're measuring, but the JIRA mentions that among others you're ignoring arrays.\r\nI've sent an email many months ago highlighting the urgency of getting rid of some Collections altogether (not just optimise them), as I had used several tools (among others flight recorder and java object layout), these can also help you to identify the biggest offenders.\r\n"}}