Nirmal IMO we should fix this without delay. Bad code is bad code ... leaving it around is a bad idea and will lead to a bad experience for users resulting in bad reputation.
Did I say bad enough times in that sentence? Very bad. Sanjiva. On Tue, Feb 18, 2014 at 5:56 PM, Nirmal Fernando <nirmal070...@gmail.com>wrote: > Yes, it would be a better solution, but it would need some refactoring and > probably will do it for beta release. > > Adding thread.sleep made all the Stratos processes run with 0-1% CPU usage > where earlier some of them were 100-200%. > > > On Tue, Feb 18, 2014 at 11:17 PM, Afkham Azeez <afk...@gmail.com> wrote: > >> Nice work on finding this issue. There is no excuse for writing such >> sloppy code since all modern IDEs show such code as warnings. BTW the >> correct fix for this would be to use an executor, not Thread.sleep >> On Feb 17, 2014 5:20 PM, "Nirmal Fernando" <nirmal070...@gmail.com> >> wrote: >> >>> Add a bit more, >>> >>> * how I found that CPU is spinning by using the 'top' command and >>> examine the process. >>> * how I found the culprit code is by following >>> http://nirmalfdo.blogspot.com/2013/05/how-to-find-culprit-when-cpu-starts-to.html >>> >>> >>> On Mon, Feb 17, 2014 at 5:09 PM, Nirmal Fernando <nirmal070...@gmail.com >>> > wrote: >>> >>>> Hi Guys, >>>> >>>> Please keep in mind not to use mere while true loops in code, which >>>> leads to CPU spinning issues. >>>> >>>> If you ever want to write an empty while true loop, please add a >>>> Thread.sleep at least. >>>> >>>> I've identified them and fixed in commits; >>>> 8c2a02374494d4eb017e2ecff09852 >>>> 341606d4d0, ff962936a870590b8f1a722f1e56f4 >>>> f05207770e, 3fd80640b2dc49f6107b9c90f39581 >>>> 7235c4667d >>>> >>>> Thanks. >>>> >>>> -- >>>> Best Regards, >>>> Nirmal >>>> >>>> Nirmal Fernando. >>>> PPMC Member & Committer of Apache Stratos, >>>> Senior Software Engineer, WSO2 Inc. >>>> >>>> Blog: http://nirmalfdo.blogspot.com/ >>>> >>> >>> >>> >>> -- >>> Best Regards, >>> Nirmal >>> >>> Nirmal Fernando. >>> PPMC Member & Committer of Apache Stratos, >>> Senior Software Engineer, WSO2 Inc. >>> >>> Blog: http://nirmalfdo.blogspot.com/ >>> >> > > > -- > Best Regards, > Nirmal > > Nirmal Fernando. > PPMC Member & Committer of Apache Stratos, > Senior Software Engineer, WSO2 Inc. > > Blog: http://nirmalfdo.blogspot.com/ > -- Sanjiva Weerawarana, Ph.D. Founder, Chairman & CEO; WSO2, Inc.; http://wso2.com/ email: sanj...@wso2.com; office: (+1 650 745 4499 | +94 11 214 5345) x5700; cell: +94 77 787 6880 | +1 408 466 5099; voip: +1 650 265 8311 blog: http://sanjiva.weerawarana.org/; twitter: @sanjiva Lean . Enterprise . Middleware