Oracle will replace Linux in its Exadata offerings (Database Machines)

09:32AM Jul 26, 2010 in category General by Zoltan Farkas

As expected work is in progress to replace Linux as the OS building block in Oracle's Database Machines:

http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6965606

Optimizations are being done for a "solexadata_demo"

Nice to see Linux being replaced by the best OS :-)

Comments[0]

Disk, memory, cpu are not cheap

04:33PM Jul 25, 2010 in category General by Zoltan Farkas

With the new generation of developers I increasingly see less desire of writing efficient code. It also makes me quite angry when I hear arguments like "disk is cheap", "memory is cheap", ... "premature optimization is evil".

Writing code is a difficult task, it is a continuous balancing between implementation choices,  but writing a efficient implementation is not always hard and time consuming.

I will give a small, recent example:

I recently spent 10 minutes of my time to optimize a data cache component that was taking up 250 Mb of RAM, and reduced the memory usage by 150Mb. Since this optimization was on a component that was reused in several processes my 10 minutes spent became even more valuable. All I did I internalized the string attributes that were highly redundant.

By reducing the amount of memory my application uses, I also increased the performance:

Less GC overhead, higher CPU cache hit ratios, less interconnect utilization (NUMA), more memory available to the disk cache, less process swapping.

One of the metrics you can monitor is:  "cycles per instruction"  (how to measure: http://blogs.sun.com/brendan/entry/amd64_pics). This metric can improve significantly by reducing your memory footprint.

Conclusion: Using String.intern is a simple and efficient way of optimizing your implementation.


Comments[0]

New x86 server from sun, now Oracle X4800 8 socket * 8 core * 2 thread

10:07PM Jun 28, 2010 in category General by Zoltan Farkas

My "favorite" part of the brochure: "the ideal server to refresh inefficient and outdated HP Itanium and IBM Power servers." 

They also forgot to mention that the servers are unbreakable :-)

Comments[0]

ZEL and floating point representations

09:54AM Feb 23, 2010 in category Java by Zoltan Farkas

Comments[0]

ZEL and deterministic functions

09:39AM Feb 23, 2010 in category Java by Zoltan Farkas

A few days of bad wether and the ZEL language gets some significant enhancements:

Deterministic functions:

Q: What is a deterministic function?

A: A funtion that always returns the same value, for the same parameters.

How do we define a deterministic function:

fib= lambda deterministic (x) { fib( x-1) + fib( x-2); };

fib(0)=0; fib(1)=1;

[Read More]

Comments[0]

ZFS Deduplication is here!

02:31PM Nov 03, 2009 in category General by Zoltan Farkas

You can find more info here:

http://blogs.sun.com/bonwick/

Congrats to jeff & co.

One more reason to use opensolaris for your file serving needs. If you want to build your own here is a good example:

http://blogs.sun.com/mebius/entry/diy_home_nas_box_with2

Comments[0]

Introduction to Green Programming - XML the Software Hummer

10:54PM Oct 13, 2009 in category General by Zoltan Farkas

Today's latest trend is going Green, everybody is talking about reducing it's carbon footprint, we have Green cars, Green Buildings, Green Data Centers,.....

The major hardware vendors battle each other on who makes the most energy efficient hardware, and some electricity utility companies even offer rebates for using energy efficient hardware (ex: Sun's UltraSparc T1). 

[Read More]

Comments[0]

Import your Microsoft Project tasks into Outlook

10:50AM Aug 25, 2009 in category General by Zoltan Farkas

One day, I wanted to get my MS Project tasks into MS Outlook, here is how I did it:

http://geekswithblogs.net/nestor/archive/2006/12/29/102260.aspx

Comments[0]

Why do I love Solaris

10:56AM Jun 30, 2009 in category Solaris by Zoltan Farkas

There is no secret that I am a big Solaris fan. For me as a developer ZFS and DTrace changed my life, improoving my productivity significantly. With ZFS and its snapshoting/cloning capabilities, I have no fear in doing experiments and I can always go back in time and recover in case something goes wrong. On the other hand DTrace with D-Light allows you to look inside your running application.

If you want to learn more there is an excellent tutorial that describes how to use DLight to profile your applications:

http://developers.sun.com/sunstudio/documentation/tutorials/d_light_tutorial/index.html

 

Comments[0]

Java's BigNum vs Gnu MP Bignumber JNI implementation

12:08PM Jun 15, 2009 in category General by Zoltan Farkas

I was wondering if I can improve the performance of my number computations in ZEL by using the Gnu MP library, so I went ahead and implemented a native version of BigInteger called OperableBigInteger

The class OperableBigInteger has a private transient member pointer of type long(to work on 64 bit systems too) that holds a reference to mpz_class. The finalize method is the one that deletes the object referenced by pointer :-) (finally I found a good use for it...)

a sample implementation for add would look like:

JNIEXPORT jlong JNICALL Java_net_sf_zel_nr_OperableGNUBigInteger_add__JJ
  (JNIEnv * env, jclass theClass, jlong pointer1, jlong pointer2)
{
    
    return (jlong) new mpz_class(*((mpz_class *) pointer1) + *((mpz_class *) pointer2));
}

I was a bit surprised to find out that my native implementation of BigInteger is twice slower than the JVM implementation...

I will need to verify my tests and the implementation, but my feeling is that this is a good example of the significant overhead JNI adds...

I have used OpenSolaris for my tests, and my tests were all 32-bit.

[Read More]

Comments[0]

Setup XVNC on opensolaris

11:38AM Jun 12, 2009 in category General by Zoltan Farkas

My server, as every member of my family recently moved to Jersey City, so I i finally  was forced to configure vnc on it to be able to do my unix work.

The Xwin redirect does not work as well as VNC even on my local network...

found this useful blog that assisted me:

http://blogs.sun.com/scf/entry/vnc_setup_on_open_solaris

one thing to add, reboot is not necessary you need only: svcadm refresh xvnc-inetd
[Read More]

Comments[0]

Lambda functions in ZEL

07:19PM Jun 02, 2009 in category General by Zoltan Farkas

I have added support for lambda expressions in ZEL, also added a FOR statement that can iterate all variables that match a wildcard and apply a lambda function to it.

abc=1;

afe=2;

bfa =3;

x=0;

result=for("`a*`",lambda(x=x+arg(0);));

print x; // x will be 3

Functions are objects, so you can do, and apply using the () operator:

x = lambda(return arg(1)+arg(0);); z= x(1,2); print z;  //will return 3

[Read More]

Comments[0]

Programming in C++ and Java, how to maintain style

05:29PM May 28, 2009 in category General by Zoltan Farkas

In my projects I am required to switch back and forth from C++ and Java.

The typical reason for using C++ is performance and tight integration with OS/Hardware (ex: process management).

The typical reason for using Java is coding speed and portability.

One of the major barriers  that I encounter in my development work  is how software is organized in C++ vs Java, at this chapter java is arguably better than the classic  C++ way. (the hpp/cpp separation is evil :-) )

I found an interesting article about how C++ code can be organized in a more Java like way:

http://strlen.com/rants/javaclassesincpp.html

Now I think this might work if you create "modules" (groups of classes) ....

[Read More]

Comments[0]

The classic program that prints itself in java

11:40AM May 22, 2009 in category General by Zoltan Farkas

The last time I solved this problem in C, now here is the java version
[Read More]

Comments[0]

Problem: My application is using too much CPU

05:07PM May 21, 2009 in category Java by Zoltan Farkas

Customer informs you: "Application is not working". You log in into the system, check the app processes, you see all of them there, you run a top or prstat and you notice one of them hugging a CPU/Core way too tightly.What can you do ?
[Read More]

Comments[0]

Mavenizing Nasa's Worldwind Project

07:29PM May 13, 2009 in category General by Zoltan Farkas

I stumbled a few years ago upon the NASA worldwind project, at the time it was quite unusable on most platforms (lack of powerful hardware graphics), however the project progressed quite a bit since and even works on my opensolaris workstation today... I was quite surprised to see a seamlessly working 3d mapping applet on my obscure OS... Now this was enough to grab my attention, so I went on and explored the project a bit.
[Read More]

Comments[0]

A comparison between IBM and Sun

05:41PM Apr 09, 2009 in category General by Zoltan Farkas

Last few weeks, the technology news were dominated by the IBM and SUN merger rumors. I went on to do some reading on Sun blogs and found:

 Jonathan's opinion about IBM - Redhat relationship: http://blogs.sun.com/jonathan/entry/ibm_is_in_a_pickle

I also found a simple and funny comparison between IBM and SUN cultures done by a Sun employee:

http://blogs.sun.com/gameguy/entry/sex_at_ibm_and_sun


Comments[0]

PLDoc 0.9.0 Release

12:09PM Mar 31, 2009 in category Sql by Zoltan Farkas

I have contributed a Maven 2 plugin for the pldoc project, the plugin is also available in the central repository.

One excuse less to document your PLSQL code.

Comments[0]

ZFS application integration example: Hudson

03:30PM Mar 30, 2009 in category Java by Zoltan Farkas

Comments[0]

Oracle Heterogeneous Data Access, NOT!

11:32AM Feb 12, 2009 in category Java by Zoltan Farkas

Sometimes you have a reporting application running reports on a oracle database. Your oracle database might consolidate data from quite a few mysql databases (via ETL). However some detail data remains always on the mysql databases. Of course the day will come when the reporting application will need the ability to drill down to the detail data from the mysql databases.

That day you will read up on Oracle Heterogeneous Data Access, ODBC, Mysql Proxy...

In case you need only read access to the mysql databases,  you might not feel like dealing with licensing for Oracle Heterogeneous Data Access via ODBC or Mysql protocol manipulation in LEA. Here is what you might want to do:

Use oracle table functions implemented in java to access your mysql tables via JDBC and your queries might look like:

select * from table (typeName_FT('SELECT * FROM remoteTable where condition' ,'jdbc:mysql://host:port/database', 'user', 'password', timeout,'typeName'));

(to create typeName_FT table function you need to call createSqlObjects defined in the code that follows)

To write a java stored procedure is straight forward, use your favorite IDE, make sure your JVM is same version with the Oracle JVM, after you are done, load your jar[s] with:

loadjava -thin -user user/password@localhost:1521:[sid] -resolve -verbose {path}/*.jar

your java stored procedures/functions are nothing else than java static functions, however for you to access them from plsql you need to create a PLSQL call wrapper:

   CREATE OR REPLACE PROCEDURE createSqlObjects( p1 IN VARCHAR2,
      p2 IN VARCHAR2,
      p3 IN VARCHAR2,
      p4 IN VARCHAR2,
      p5 IN VARCHAR2)
      RETURN VARCHAR2 AS
      LANGUAGE JAVA NAME 'mypack.JDBCUtil.createSqlObjects(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String)';

 

Here is the java source you need for my sql example:

[Read More]

Comments[1]

Opensolaris 11.08 on a Dell XPS 730

11:10AM Dec 17, 2008 in category General by Zoltan Farkas

Got a new "workstation" from Dell, a XPS 730 with the new Core I7 cpu and DDR3 memory. (the usual with Dell, you always feel funny when you buy from them with their confusing deals and coupons...)

This machine is basically a gaming machine, but I thought that opensolaris would not complain about it ...

Hmm, instalation was far from painless...

the following parts were not recognized out of the box:

1. Nvidia gforce 9800 GTS

2. Broadcom Netlink BCM5784M Gigabit Ethernet

3. Creative Labs Sound Blaster XFI

the video card problem I resolved with help from the xwin-discuss mailing list:

# update_drv -a -i '"pci10de,605"' nvidia
# reboot

The sound card I have attempted to resolve with oss, however the sbxfi driver provided is beta and looks like it does not recognize my card... I have posted my issue on the driver-discuss mailing list ... hope that a future update will resolve the issue.

UPDATE: I have removed the plastics that were covering the onboard audio, removed the creative card and activated in BIOS the onboard audio and I have some bad quality sound on my system right now, better than nosound.

Sun's project boomer will redo the Sun audio and marry it with the open sound system, expected delivery will be in snv_115, meanwhile I am working with the beta code from http://www.opensolaris.org/os/project/opensound/files/

The Network card issue I temporarily resolved by installing a pci network card that was recognized by opensolaris. Meanwhile a RFE has been filled: http://bugs.opensolaris.org/view_bug.do?bug_id=6786742   it does not look like too much priority is given to desktop cards by Broadcom, well I will have to go ahead and purchase a card from their competitors...

Comments[0]

Jboss Drools as a rule based engine inside your applications

12:11PM Nov 19, 2008 in category Java by Zoltan Farkas

JBoss Rules is one of the best open source rules engines available to integrate inside your application (for more information on features: http://www.jboss.org/drools/).

JBoss Rules provides both a Rule Engine and a Rule Management System (Guvnor).

1. Integrating the Rule Management System UI.

Guvnor is a web based jbrms that allows you to create, test, deploy your rules and a lot more. It uses Apache Jackrabit to persist the rules, Apache Jackrabbit is a fully conforming implementation of the Content Repository for Java Technology API (JCR). here is how your J2EE app will look like:

 

 You will need to create an war maven 2 project that will overlay the guvnor war, and allow you to customize rules persistence and integrate security, for this you will only need to customize components.xml located in WEB-INF.

here is how your pom.xml will look like:

<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <artifactId>my-guvnor</artifactId>
    <name>My Guvnor - ${version}</name>
    <groupId>my-apps</groupId>
    <packaging>war</packaging>
    <description>drools guvnor jbrms overlay project</description>
    <version>my.version</version>
    <dependencies>
        <dependency>
            <artifactId>drools-guvnor</artifactId>
            <groupId>org.drools</groupId>
            <type>war</type>
            <version>5.0.0.SNAPSHOT</version>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <warSourceDirectory>src/war</warSourceDirectory>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

in src/war you will add your version of components.xml (based on the one from the guvnor war).

in your pom.xml from your application ear you will add your guvnor overlay web module:

                        <webModule>
                            <artifactId>my-guvnor</artifactId>
                            <groupId>my-apps</groupId>
                            <contextRoot>rules</contextRoot>
                        </webModule>

You will also need to add some menu item or buttons to jump to your new BRMS GUI from your app and you have a brand spanking new gui module in your app.

2. Integrating the Rule Engine:

create a rule agent:

agent = RuleAgent.newRuleAgent("/rules.properties");

where rules.properties can be:

newInstance=true
localCacheDir=/tmp
url=http://localhost:8080/rules/org.drools.guvnor.Guvnor/package/com.mycompany.myapp/production
poll=30
name=myrules

the RuleAgent will poll for rules at the provided url (where your BRMS GUI will publish them).

Create a statefull engine session, assert your facts and fire your rules:

ruleBase = agent.getRuleBase();
session = ruleBase.newStatefulSession();

session.insert(fact1);
...

 

session.insert(factn);
session.fireAllRules();       

And enjoy troubleshooting and debugging the new world of declarative programming issues that are in my view not any easier to debug...

[Read More]

Comments[0]

Time Machine on Solaris

12:18PM Nov 13, 2008 in category General by Zoltan Farkas

I upgraded to snv101a and to my surprise a feature called Time Slider was available.

The implementation is quite nice, in nautilus you have a time line slider that you activate pushing the new time buton in the toolbar, you slide to the desired point in time right click on the file/folder you want to recover and select restore to desktop ...


[Read More]

Comments[0]

Migrating from Maven1 to Maven2

11:51AM Oct 03, 2008 in category General by Zoltan Farkas

We were Maven 1.X early adopters and used m1 for the last 4 years and saved us from the "jarmagedon" at the time . Maven1 increased componentization in our company and as a result we have 200+ internal maven projets.[Read More]

Comments[0]

Installing Oracle Client on OpenSolaris

12:38PM Sep 18, 2008 in category General by Zoltan Farkas

Installing oracle client on opensolaris is not quite straightforward, both opensolaris and oracle will protest against it.[Read More]

Comments[0]

Getting up to date with opensolaris (snv_64 -> snv_96)

10:19PM Sep 06, 2008 in category Solaris by Zoltan Farkas

Finally a rainy day to give me some time to update my workstation/server to a newer release of opensolaris. 

This is why:

1. ZFS everywhere,  I used to have UFS, with 2 alternate boot environments. With ZFS I will have more flexibility in my experiments (snapshots to rollback in case something will go wrong, clones for test environments), it is so easy with ZFS...

2. IPS for the easier updates and installs.

3. Up to date desktop environment.

[Read More]

Comments[0]

3 weeks on my motorcyle around california

07:44PM Jun 06, 2008 in category General by Zoltan Farkas

The trip was an amazing experience, we rode through lonely desert roads, dense forests, twisty mountain passes, spectacular coastal roads... This trip is mandatory once in a lifetime for anybody who considers himself a biker. (includes a visit to mecca)
[Read More]

Comments[0]

Learning something new every day: java.lang.OutOfMemoryError: GC overhead limit exceeded

10:32PM Mar 28, 2008 in category Java by Zoltan Farkas

Since I started writing java applications about 10 years ago I saw quite a few OOMs, today I had the honor to see a new one:

java.lang.OutOfMemoryError: GC overhead limit exceeded

Hmm, so if the garbage collector is running like crazy (98% of the time) then the jvm will throw a OOM. This seems to be a feature of the paralel GC ...

[Read More]

Comments[0]

Java Exception Handling Best Practices?

11:40AM Nov 18, 2007 in category Java by Zoltan Farkas

I see a lot of java code every day with code that does Exception handling in non-conventional ways (download jboss or glassfish sources and take a look and see the aboundance of catch(Throwable)). Here is my opinion about theese practices and it is pretty much in line with the java documentation.

[Read More]

Comments[0]

Running Oracle on ZFS Solaris 10 U4

02:58PM Oct 26, 2007 in category Solaris by Zoltan Farkas

Duplicating a Oracle database running on a Sun fire X4200 + T3 disk array(Solaris 10U1 + UFS) to a Dell PowerEdge 2950 with a JBOD running Solaris 10 U04 and ZFS. The workload of this database is a warehouse workload and expectations are that ZFS compression will reduce io and improve overall performance. Theese tests focus on the impact of filesystem compression on performance.
[Read More]

Comments[0]