Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am using eclipse on Ubuntu 10.10 32bit, when I am compiling a huge android project, it is getting slower I have 4GB ram even (which is just 25% used) though its getting slower when I observed further eclipse is using only one CPU and creating 100% load on that where as other CPU is having only 20% load, is this eclipse problem or Ubuntu problem

share|improve this question
add comment

3 Answers 3

up vote 2 down vote accepted

Eclipse and the Java Development Kit used by Eclipse has approximately nothing to do with your development, with the development of an Android Application using the standard SDK.

To clarify this point you can consider 3 important facts:

  • you can build a complete Android App from the source without using Eclipse
  • Eclipse is only an IDE for the Android SDK, a group of graphical elements that can speed up your workflow, nothing more and nothing less
  • Eclipse uses a JDK environment when the Android SDK does not ( the A. SDK uses nothing else rather then the SDK itself ), they simply use different environments to run and build apps, so it's simply misleading saying something like "Eclipse not using dual core when compiling a huge Android project"

I think that at this point should be clear the fact that your app is actually compiled by the SDK itself and what you are stressing as bad thing is usually referred as a good thing.

Multithreaded application and, in general, application ( with "application" right now i mean the SDK not your app ) that supports their execution splitted in several jobs, brings a big problem on the table: a good and effective debugging phase. Let's say that you are compiling something splitted in 4 threads, in the istant X your compiler crash, the question is: which of the 4 is the bad guy? all of them? just 1? 2? 3?

Considering that a tipical use of the Android SDK is not heavily based on multi-threaded design ( with that i mean that a developer can wait 1 or 2 minutes in the worst case scenario, nothing changes and the debug in multi-threaded environment with some concurrency on the go is much more complex and can take you weeks without achieving any results ), the adoption of a multi-threaded design can easily provide more cons than pros, especially during the phase of compiling and debugging.

In the end considering the audience of developers, the target of Android, what an Android application really is, this kind of software design is probably the most appropriate and effective and i will not considering the lack of a multi-threading compiling a bad thing.

share|improve this answer
    
Great explanation. –  Sandeep Manne Dec 5 '11 at 12:55
add comment

Taken from eclipse's wiki page.

Multi-Core CPU

Due to power constraints, there is a trend towards multiple cores on a CPU instead of merely increasing the CPU frequency. Eclipse could enable developers to write multi-threaded programs to take advantage of the increasing miltiple cores. Moreover, Eclipse itself could be optimized where possible for running on multiple cores.

Eclipse it self itself has not multi-thread support, that means that no mater how many CPUs/CPU cores you have eclipse will run in one of your cores only.

More over, the ability for a compiler to use multiple CPUs/CPU cores will depend on which language you are using to develop your Android project.

Some compilers will be able to use multiple CPUs/CPU cores during compilation even if the IDE you are using does not take advantage of those.

The Linux Kernel has support for multiple CPUs/Cores in one system since Kernel version 2.0 allowing your programs to take advantage of that, but the program itself has to have support for multiple CPUs/Cores.

For more information on how Symetric multiprocessing works can be found here.

In short: Ubuntu has support for SMP because current Kernel version is < 2.0 (also on 9.10 as you know) but eclipse lacks the habitability to use multiple CPUs/Cores. Also even if eclipse had it it would (during project build) depend on the language and compiler you are using for your project.

This is all true no mater what compiler you are using including the ones in the Android SDK.

share|improve this answer
add comment

Presuming you use make as the project builder, and your dependencies are written correctly, your best best is probably to use parallel make. I think eclipse has a tick-box for that, but if not just add -j2 to the builder parameters (where '2' is the number of jobs to run concurrently - experiment and see what's best for you).

share|improve this answer
    
I am using android builder –  Sandeep Manne Dec 5 '11 at 12:46
    
OK, well maybe that will have a parallel option? –  ams Dec 5 '11 at 16:02
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.