Flutter - Slow gradle build - performance

I have recently started Flutter development and on my machine, and the gradle build seemingly takes forever when completely restarting the app or running it for the first time, at times it gets quite frustrating. I am using an Ubuntu 20.04 (KDE Plasma env) with 8 GB RAM/ 240 GB SSD and using VS Code for running the app. Is there any way to optimize this? Would appreciate any suggestion on the same. Thanks in advance.

According to this documentation by developer.android.com there is a way to optimize gradle build by using JVM Garbage collector.
Add this parameter to your gradle.properties in your android folder you can find it on /{your-project}/android/:
org.gradle.jvmargs=-XX:+UseParallelGC
and if there are already value set in this field, just add a new option:
org.gradle.jvmargs=-Xmx1536m -XX:+UseParallelGC

Related

Gradle throws OutOfMemoryException on build

I'm trying to setup / clone an existing grails-project. I managed to install it fine on several windows/macos computers and also 3-4 servers running Ubuntu (ranging from 16.04 to 20.04). But the newest vServer I rented seems to have some problems regarding the gradle-build, as it always throws an OutOfMemoryException, no matter what I try to do.
I already tried increasing the maximum memory size, that grails / gradle are allowed to use but I still get the OutOfMemoryException. I managed to narrow it all down to gradle, which seems to have a problem with the vServer, which has no swap-memory - that's what I read out of everything gradle told me in the error-log:
There is insufficient memory for the Java Runtime Environment to continue.
Cannot create GC thread.
Out of system resources.
Possible reasons:
- The system is out of physical RAM or swap space
Other than that, i noticed, that gradle uses around one to 1,5GB of memory before crashing - but I assigned him with up to 6GB using -Xmx6G (note that the system has 8GB availaible)
Maybe someone here can help me and tell me what I can do to solve this / get grails up and running (I tried everything I could find).
Attached I have the stacktrace of the (failed) build: https://pastebin.com/Kv2c4gu0
Thanks in advance.
EDIT:
The server has 8GB of memory; 4 cores;
I installed Java 1.8.0_252 through the openjdk 8
Gradle should be the version 4.4.1
Grails is installed with the version 4.0.1
The problem has been resolved:
The vServer had 0b of swap-storage, which led to gradle/grails throwing an error of insufficient memory.
All I needed to do was create a swap-partition to have gradle compile.

slow mozilla firefox build

I'm having a problem trying to build mozilla firefox. Despite the fact that my system is quite decent (i5 processor, 16 gb ram, ssd) , the build is very slow. I've used mk_add_options MOZ_MAKE_FLAGS="-j4" option in the mozconfig but my CPU is still at 1-2% of usage.
Is there something that I am missing?
The initial build can take from 10 minutes to more than an hour, depending on the OS, the build machine specs, and the build configuration.
Has your build finished at all? What do you call "slow"?
What OS are you building on? Windows, for example, is much slower to build.
What version of Firefox are you building (m-c tip? an old version?)
What's your build configuration (mozconfig)? Are you doing a debug or a release build? Any non-standard options? Did you try artifact builds?
Paste the build log, in particular it prints how much resources it took to build just before the end of the build.
Do you have A/V or other system software? Did you instruct it to ignore the objdir?

TeamCity and YouTrack in under 1GB

I am trying to setup YouTrack and TeamCity on a VM with less than 1GB running on Windows. There will be a very low usage (both users and requests). This is a POC environment, if it works I may push it onto an extra-small or small Azure or Amazon VM instance.
Anyone has got this to work?
PS: I understand that this is way below JetBrains recommended settings.
I have a running YouTrack instance with only 256MB RAM allocated (never tried a smaller value), on an old server with only 1GB RAM, under Debian. It feels pretty responsive, but I'm the only user so far :D
If you're using Windows XP, it might work ok, if Team City would run with only 256MB RAM.
Is there a specific need for using TeamCity, or you need it only for integrating YouTrack with Git/Mercurial/SVN?
I tried installing WARs under TomCat and I could not get TeamCity to play nice in TomCat 7. I ended up using the out of the box installers provided by JetBrains and all worked fine.
I have resolved same problem in the next way:
Installed application on VM with more than 1 GB memory.
Configured my application.
Reduced size(memory) of the VM to 700 Mb available
As application was used JetBrains YouTrack 6.0 with 250 issues and 3 users. It was failing to install from msi package on VM with 700 Mb of memory. After processing mentioned steps it works fine.

XCode 4.2 Slow performance

I have installed XCode 4.2 on my macbook with specifications 2.1 GHz and 4GB of RAM. On few projects which were created using older version of XCode, my XCode slows down too much. It takes above 1.8GB of RAM and CPU Usage of about 153%. As result, my machine slows down too much and I experience very poor performance. I tried deleting workspace file from the project file but it also did not help much. One thing what I have noticed in Activity Monitor is that with XCode, there are one or two instances of Git as well. Is it the cause of this problem? Git instance is taking around 30% to 70% of CPU usage. Can anyone please help me in this regard?
Best Regards
Hi I fixed it by disabling SVN and Git plugins of XCode. Simply go to /Developer/Library/Xcode/PrivatePlugins
Now find IDEGit.ideplugin and IDESubversion.ideplugin
Change names of both of above plugins so that xcode will not be able to execute them in future. Now restart your xcode and enjoy better performance.
Best Regards

Buildserver for MonoTouch upon OS X?

I am taking my first steps in the world of iPhone/iPad development with MonoTouch and wish to adopt the practices that I adhere to in my "day" job.
Is there a buildserver for OS X that plays nice with MonoTouch/Nunit?
Thanks kindly,
Dan
Assuming you have MonoDevelop and MonoTouch installed, you can build solutions using the MonoDevelop commandline tool:
/Applications/MonoDevelop.app/Contents/MacOS/mdtool build
For options, run
/Applications/MonoDevelop.app/Contents/MacOS/mdtool build --help
I don't know how you'd get the actual iPhone project to build but of you farm out as much as you can to seperate projects so only the bits that need the funky MT references are in the central UI project you can at least build the rest as normal.
I've just started using TinyIoc which will help in this regard.
As for a specific build server - isnt TeamCity built using Java and Appache? If so there should be no reason why this won't work on your OSX.
That said - why would you want the build server on the same physical machine you dev on?

Resources