Book Image

Oracle ADF Faces Cookbook

By : Amr Ismail Gawish
Book Image

Oracle ADF Faces Cookbook

By: Amr Ismail Gawish

Overview of this book

Table of Contents (18 chapters)
Oracle ADF Faces Cookbook
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Tuning JDeveloper


JDeveloper can work without tuning, but tuning is worth looking at for when you are looking at big enterprise applications that have many projects with source control and more than one team member.

How to do it…

In order to tune JDeveloper, perform the following steps:

  1. Open your Oracle Home directory that we set up when installing JDeveloper, and navigate to %MIDDLEWARE_HOME% | Oracle_Home | jdeveloper. There are two files that you want to change: the first file is ide.conf located under ide\bin\ide.conf.

  2. Open the file using your favorite text editor and locate the following lines:

    AddVMOption –Xms
    AddVMOption -Xmx
    

    You may want to increase these values if they are very low, for example, if you have more than 4 GB of RAM, you should set it to 1 GB each as shown in the following code:

    AddVMOption –Xms1024M
    AddVMOption –Xmx1024M
    
  3. Save and close the file.

  4. Open the jdev\bin\jdev.conf path under the jdeveloper directory.

  5. Add the following entries at the end of the file:

    # optimize the JVM for strings / text editing
    AddVMOption -XX:+UseStringCache
    AddVMOption -XX:+OptimizeStringConcat
    AddVMOption -XX:+UseCompressedStrings
    
    # if on a 64-bit system, but using less than 32 GB RAM, this reduces object pointer memory size
    AddVMOption -XX:+UseCompressedOops
    
    # use an aggressive garbage collector (constant small collections)
    AddVMOption -XX:+AggressiveOpts
    
    # for multi-core machines, use multiple threads to create objects and reduce pause times
    AddVMOption -XX:+UseConcMarkSweepGC
    AddVMOption -XX:+UseGCOverheadLimit

    These settings ensure that your JVM is optimized for your operating system. Also note that some of them are tailored depending on your Operating System architecture. So, don't just copy and paste them. Check what can apply and add accordingly.

    Tip

    If you started JDeveloper and faced some troubles, try reducing the amount of memory assigned with Xms and Xmx and start it again.

  6. Start JDeveloper now. You have tuned it for your operating system, and now it's time to change some general preferences of JDeveloper itself. So, let's start by starting your JDeveloper as shown in the following screenshot:

  7. When you get a prompt that asks which mode you want to choose, leave the default value of the Studio Developer (All Features) option and click on OK.

    Tip

    If this is not your first JDeveloper, you will also be prompted to migrate from the older JDeveloper versions. If you are planning to still use the old JDeveloper version and don't want to migrate your project, click on No; otherwise, click on Yes.

  8. Go to the JDeveloper preferences by navigating to Tools toolbar | Preferences.

  9. Change the following inside preferences:

    • Environment: Change the Encoding to UTF-8

    • Navigate to Code Editor | Line Gutter and enable Show Line Numbers

    • Navigate to Run | Weblogic and click on Load Extension and enable FastSwap

  10. Enable external tools by navigating to Tools | External Tools and making sure every item is selected and then clicking on OK.

How it works…

JDeveloper, like all IDEs, has configuration files that can be used to tune it to work without having memory problems. These configuration files are ide.conf and jdev.conf.

The first file controls the main JVM memory parameters that the JDeveloper thread will start using, and jdev.conf is used to add any additional configuration to the JDeveloper in order to enhance its performance with multicore processors or 64-bit architecture systems.

After that, we started JDeveloper for the first time and you were prompted to select a Role or Mode. Each role is tailored towards a specific behavior.

There are 5 roles you can choose from:

  • Studio Developer (All Features): This includes all the features of the IDE

  • Customization Developer: This allows the developer to create customizable applications using the Oracle Metadata Service (MDS) framework

  • Database Edition: This gives access to the core database development tools

  • Java EE Edition: This includes features of core Java EE development only

  • Java Edition: This includes only features of core Java development

After starting JDeveloper, we also need to tune the JDeveloper preferences themselves. This is different since you have control over them from the JDeveloper IDE. So, you may want to change them while you are working. Secondly, it doesn't relate to the JVM thread but it's totally an application-specific property.

Doing these changes to the JDeveloper preferences can increase your performance time by preventing you from facing some problems with encoding and other stuff when you are working with other team members or a multilanguage application.

See also

If you want to explore more properties that you can tweak with JDeveloper beyond the scope of this book, check the ADF EMG discussion at https://groups.google.com/forum/#!topic/adf-methodology/g3q8TgHtsbk.

Tip

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. You can also download the files from GitHub at https://github.com/agawish/ADF-Faces-Cookbook/archive/master.zip. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.