Saturday, November 21, 2015

Manage Memory for permanent generation space (permgen)

If your JDeveloper IDE  is slow, you can increase the memory by: 
Edit the "jdev.conf" file located at path "YOUR_Oracle_Home\jdeveloper\jdev\bin​"
and add following line:
AddVMOptionHotspot  -XX:MaxPermSize=1024M

also you can show the consumed memory and force for garbage collection by adding the following line:
AddVMOption -DMainWindow.MemoryMonitorOn=true

See the file after modifying:


See the change as new bar at Jdeveloper IDE, the arrow points to link that do job for Garbage Collecting:
  • Now you are more far from the error: OutOfMemoryError PermGen Space Error.
  • Java 8 is moved from PermGen Space to Metaspace.Java Metaspace space setting is to be unbounded (dynamic resize) by default.
  •  JDeveloper 12.1.3 in test can be configured to develop/compile against JDK 8, and introduces support for JDK 8 language features.


http://waslleysouza.com.br/en/2014/04/increase-the-performance-of-jdeveloper-11g/
http://www.oracle.com/technetwork/developer-tools/jdev/documentation/121300-cert-2164864.html
http://java.dzone.com/articles/java-8-permgen-metaspace
http://en.wikipedia.org/wiki/Java_virtual_machine

Thursday, November 19, 2015

ADF InputColor Component

When you need to pick a color from a popup you can deal with ADF component called af:InputColor.
Use Case
Need coloring a number values according to specific ranges.
Example: 
Numbers between 0 and 50 will be colored with black.
Implementations
Create a table that saves the desired color for each specific range.
Because the InputColor  component needs a value of type Color, create a transient attribute with type java.awt.Color , you will change the type at XML level manually:
When page loads you will need to get a color object, so convert the color string to object of type color.
When you set color object you will need to convert the chose color object to string and set the color string to be saved in the database after commit.

Drag and drop the InputColor component and set it's value to the color object attribute.

The result will looks like this:

java - fill distinct objects in ArrayList

If you have a list that contains some objects that it is considered as duplication when two or three fields of these objects are equal. How ...