Mock tests, Interview questions, Tutorials and Tech news
 
 

Archive

Archive for September, 2010

Big memory for ehcache and terracota

September 30th, 2010 Vinay No comments

In the last post, Alternative to java garbage collection – BigMemory , we had talked about Terracotta switching to Big memory replacing JVM because of its memory cache requirements .

Here is another useful link on What BigMemory is, Why it was built and How it helps an application.  You can find it here.

How to check guaranteed RAM in VPS

September 28th, 2010 Vinay 2 comments

When using VPS services, one of the questions that come to mind is “Am i getting the resources that I have paid for in my VPS ” ?

On telnet prompt

type

cat  /proc/user_beancounters

you will see something like this

uid  resource           held    maxheld    barrier      limit    failcnt
101: kmemsize       10069594   10087306   33554432   36909875          0
lockedpages           0          0       8192       9011          0
privvmpages      151948     151955     262144     262144        484
shmpages           3407       3407      32768      32768          0
dummy                 0          0          0          0          0
numproc             186        186        768        768          0
physpages         75888      75892          0 2147483647          0
vmguarpages 0          0     131072 2147483647          0
oomguarpages      79627      79631     266240 2147483647          0
numtcpsock           67         67       1080       1080          0
numflock             11         11        564        618          0
numpty                1          1         48         48          0
numsiginfo            0          1        768        768          0
tcpsndbuf        500636     500636    5160960    8110080          0
tcprcvbuf        602016     602016    5160960    8110080          0
othersockbuf      27736      27736    3378240    6291456          0
dgramrcvbuf           0       1400     786432     786432          0
numothersock         32         32       1080       1080          0
dcachesize            0          0   10727424   10874880          0
numfile            5873       5882      27936      27936          0
dummy                 0          0          0          0          0
dummy                 0          0          0          0          0
dummy                 0          0          0          0          0
numiptent            43         43        384        384          0

Read more…

directory checksum error

September 27th, 2010 Vinay No comments

If you are trying to install some file on unix/linux using this command

tar xzf filename.tar.gz

and it is not working , try this 2  stage command

gzip -dc filename.tar.gz | tar xf -

Categories: Programming / tutorials Tags:

For those naysayers who say Java will be dead…

September 26th, 2010 Vinay 2 comments

There has been lots of speculation on Java and its future. Some people complained that they are not seeing much progress happening in future releases.  They had more to fear when Oracle bought Sun Microsystems and with it the Java. Will it be end of Java ? Time to switch  ?

Last week In Oracle world, Oracle has unvielded Exalogic  Oracle Unveils Exalogic Elastic Cloud , which apart from tons of feature which you can read on Oracle’s blog ,comprises the latest high performance x86 hardware, the industry-leading Oracle WebLogic Server, and Exalogic software, all engineered by Oracle for maximum capability with minimum set-up.

In Oracle’s internal testing one rack of Oracle Exalogic Elastic Cloud demonstrated:
12X improvement for Internet applications, to over 1 Million HTTP requests per second.
4.5X improvement for Java messaging applications, to over 1.8 Million messages per second.

What is noteworthy that Oracle Exalogic Elastic Cloud offers unmatched performance and reliability for Java applications. Read more…

Integrating selenium with maven

September 25th, 2010 Vinay 1 comment

In the last post , we talked about Unit testing with Selenium. In this post , we will talk about how to integrate selenium with Maven and run your unit tests with maven. It assumes that you are already familiar with Maven.

Add the following dependency and plugin into your pom.xml

<dependency>

<groupId>org.seleniumhq.selenium.client-drivers</groupId>

<artifactId>selenium-java-client-driver</artifactId>

<version>1.0.1</version>

<scope>test</scope>

</dependency>

<plugin>

<groupId>org.codehaus.mojo</groupId>

<artifactId>selenium-maven-plugin</artifactId>

<executions>

<execution>

<phase>pre-integration-test</phase>

<goals>

<goal>start-server</goal>

</goals>

<configuration>

<background>true</background>

</configuration>

</execution>

</executions>

</plugin>

<plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-surefire-plugin</artifactId>

<configuration>

<skip>true</skip>

</configuration>

<executions>

<execution>

<id>integration-test</id>

<phase>integration-test</phase>

<goals>

<goal>test</goal>

</goals>

<configuration>

<skip>false</skip>

<excludes>

<exclude>none</exclude>

</excludes>

<includes>

<include>**/*Test.java</include>

</includes>

</configuration>

</execution>

</executions>

</plugin>

Keep all you tests into web-app/src/test/java folder.

Setup classpath :

Add selenium-java-client-driver.jar, selenium-server.jar and junit.jar in the classpath.

Run tests:

Execute the test from command line with the command – mvn install

How to increase heap size in tomcat 6

September 23rd, 2010 Vinay 4 comments

Most of us who have worked with Apache-Tomcat in productions systems, would have faced out of memory errors sometimes or other.  It is not that it always happens in tomcat but let us look at why does this occur and how to solve it.

Understanding Java Virtual Machine

A Java Virtual Machine on 32-bit operating systems typically has a maximum heap size of 64Mb. The JVM heap space is where all Java objects are stored, as well as memory used by the garbage collector. Sun recommends increasing this value for server applications.

Large server applications often experience two problems with these defaults. One is slow startup, because the initial heap is small and must be resized over many major collections. A more pressing problem is that the default maximum heap size is unreasonably small for most server applications.

64MB  is the heap size in tomcat as well by default and is too less for real world systems. When your application runs and you are able to analyze the app, this is what you would see

heap size in tomcat

heap size in tomcat

Read more…

Which VPS options to chose from ?

September 23rd, 2010 Vinay No comments

A very nice comparison of several VPS performance including Amazon EC2.

The user has compared the costs and performance of Linode, Slicehost, Prgmr, Rackspace and Amazon.

You can find the results here

Categories: Miscellaneous Tags: , ,

Facebook password reset scam

September 20th, 2010 Vinay No comments

If you are getting the email from facebook with subject

Facebook Password Reset Confirmation

Be very careful. Do the contents look like below ?

From: Facebook, Idella Brighter <eidfj@facebook.com>
Date: Mon, Sep 20, 2010 at 10:32 AM
Subject: Facebook Password Reset Confirmation
To: Mrabc@gmail.com

Hey,

You have requested a new password.

You can see your new password in attached document.

Please note that this email has been sent to all contact emails connected to your profile. If you did not request a new password, it’s likely that another person has mistakenly attempted to log in with the help of your login.

For more information, check our Help Center at http://www.facebook.com/help/?topic=login

Thanks,

This is a scam. McAffee  had warned users about facebook password reset scam.

No password reset are done through attachments.

Categories: Miscellaneous Tags: ,
Get Adobe Flash playerPlugin by wpburn.com wordpress themes