Wrox Programmer Forums
|
BOOK: Professional Android 2 Application Development
This is the forum to discuss the Wrox book Professional Android 2 Application Development, 2nd Edition by Reto Meier; ISBN: 978-0-470-56552-0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Android 2 Application Development section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 16th, 2011, 04:47 PM
Registered User
 
Join Date: Aug 2011
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default ToDo List High CPU usage Chapters 2 to 4

wish to delete posting as new facts emerged.

If a moderator sees this, please delete the posting.

Last edited by mtvoyd; August 16th, 2011 at 05:56 PM.. Reason: new facts
 
Old August 17th, 2011, 03:44 PM
Registered User
 
Join Date: Aug 2011
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It turns out the 100% CPU utilization problem is real, but has nothing to do with the code from the PAAD book. I am sorry for any confusion the post title may have caused. I would have deleted the post if it was possible for me to do so.

Setting up a Hello World example in Eclipse 3.5.1 and running it in various emulators (i.e. emulators established with differing versions of the android SDK) gave the same result, as did running various emulators without uploading an app. I usually develop in linux, but as it happens I have the same eclipse-sdk-adt plugin versions in Windows and the cpu utilization problem was not reproduced there. My guess (and it probably is an uneducated,wild, and wrong guess) is the problem dates to installation of the version 12 ADT plugin in mid-July.

The cpu utilization bug reappears often in various discussion threads and bug reports over the last 3 or so years. There are various workarounds, but some of them likely address issues that have already been fixed. In other words, your mileage may vary.

The most often mentioned workaround is to turn off "Orientation" in "Settings/Sound & display". This may be called autorotate in newer versions of the emulator/SDK. Switching this off did not fix the problem for me.

A purely practical move is to suspend the running emulator and resume it when needed. My biggest concern is the overheating caused by high CPU usage -- my main machine is my laptop. Here is what you can do in linux:

suspend:
Code:
killall -STOP emulator-arm
resume:
Code:
killall -CONT emulator-arm
This has the advantage of keeping an instance of the emulator around to test code when needed and avoiding the overhead of starting a new emulator, which takes 1 - 2 minutes on my machine, depending on the particular emulator version and whether it is being run for the first time. Sorry, I don't know of equivalent process commands in Windows, but I imagine they exist.





Similar Threads
Thread Thread Starter Forum Replies Last Post
High Cpu usage Cruz_240sx Classic ASP Components 2 March 20th, 2007 06:42 AM
CPU Usage Optimisation avbabu VS.NET 2002/2003 1 January 21st, 2005 07:28 AM
Optimising CPU Usage avbabu BOOK: Professional Crystal Reports for VS.NET 0 December 15th, 2004 07:23 AM
100% CPU Usage anioak VS.NET 2002/2003 0 November 16th, 2004 08:47 AM
ASP Components: 100%CPU usage and System shutdown Palani Classic ASP Components 2 September 21st, 2003 05:12 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.