srini arumugam

Greenhorn
+ Follow
since Nov 02, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
6
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by srini arumugam

Yes.. i forgot to commit.. i tried to access the records with out committing the changes ,it did not work. when i tried the same after committing the changes it worked. Thanks.
10 years ago
Thanks for the reply. I got the result. Immediately after creating the table and inserting the records I was trying to access it. Tried to execute the same program after 10 min and got the result.
Don't know may be cache refresh may took time.
10 years ago
Hi,
I tried to connect JDBC, but no results are getting displayed. Below is the code,


I tried to connect the same user(test\test) through to SQL command line and in EMPLOYEE table results are displayed.



The connection was successful, but still the results are not displayed.
10 years ago
Thanks a lot Anand and Peter.. The dollar example from peter was good.
Deployment was successful when i tried the below,
set "JAVA_OPTS=-Xms128M -Xmx512M -XX:MaxPermSize=256M"

As peter pointed out, i have reduced maximum heap size from 800m to 512m. So the operating system has some memory left to do the task..

I had one doubt with -Xss parameter. This parameter should set the size of java stack or and not the size if native method stacks.
So that by setting it to a low value or reducing it will have more memory for native method stack.

From the link,
http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html
am not able to clearly figure out the default value of UseDefaultStackSize. Am using java 1.6, So if the default stack space 512k then reducing it to 256k will free some space so that the operating system can use it.

But how does this is related to swap space? Am trying to understand what is happening.

Swapping is a process of copying pages from RAM to hard disk, so that the freed space in RAM can be used for other task.
The error is "Out of swap space? ". Out of swap space means that While trying to copy the pages from RAM to Hard disk, there is no space in the Hard disk for swapping the pages.
If so how does setting the -Xss parameter is going to help? Basically reducing the jvm stack size how will it fix the "Out of swap space" issue?


10 years ago
Hi,, Am getting the below issue when i deploy my code in "jboss-5.1.0.GA",,
An unexpected error has been detected by Java Runtime Environment:


java.lang.OutOfMemoryError: requested 352320 bytes for Chunk::new. Out of swap space?

Internal Error (allocation.cpp:218), pid=5076, tid=4692
Error: Chunk::new

Java VM: Java HotSpot(TM) Server VM (11.0-b11 mixed mode windows-x86)
An error report file with more information is saved as:
D:\jboss-5.1.0.GA\bin\hs_err_pid5076.log

If you would like to submit a bug report, please visit:
http://java.sun.com/webapps/bugreport/crash.jsp
The crash happened outside the Java Virtual Machine in native code.
See problematic frame for where to report the bug.


My JVM args are,
set JAVA_OPTS=%JAVA_OPTS% -Xms128m -Xmx800m -XX:MaxPermSize=512m
set JAVA_OPTS=%JAVA_OPTS% -Dorg.jboss.resolver.warning=true
set "JAVA_OPTS=%JAVA_OPTS% -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false"


I tried increasing the -Xmx to 1024 but no use, am getting the same issue,, there server wont even start..
I some sites the suggestion was to reduce the virtual memory size, So decreased the virtual memory size.. initially it was 37000mb then i reduced it to 6000 mb as my ram size is 4gb (i.e virtual memory more that 4096mb),,
Suggestions please...
10 years ago
Hi ,

Am using Eclipse Platform

Version: 3.4.2
Build id: M20090211-1700

And I downloaded pmd plugin from the site http://pmd.sourceforge.net/eclipse/ from which I installed version 3.2.6,

Restarted eclipse, But when I try to check java file for pmd violations , am getting the error message like below.

"An Internal error occured during code review"

When I checked the pmd log file, it showed some thing like,


2010/07/30 11:14:41,672 ERROR PMDPlugin Error executing command ReviewCode
name.herlin.command.CommandException: net.sourceforge.pmd.eclipse.runtime.properties.PropertiesException: The project ruleset file cannot be found for project
at net.sourceforge.pmd.eclipse.runtime.cmd.ReviewCodeCmd.processResourceDelta(Unknown Source)
at net.sourceforge.pmd.eclipse.runtime.cmd.ReviewCodeCmd.execute(Unknown Source)
at net.sourceforge.pmd.eclipse.runtime.cmd.JobCommandProcessor$1.run(Unknown Source)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: net.sourceforge.pmd.eclipse.runtime.properties.PropertiesException: The project ruleset file cannot be found for project
at net.sourceforge.pmd.eclipse.runtime.properties.impl.ProjectPropertiesImpl.setRuleSetStoredInProject(Unknown Source)
at net.sourceforge.pmd.eclipse.runtime.properties.impl.ProjectPropertiesManagerImpl.fillProjectProperties(Unknown Source)
at net.sourceforge.pmd.eclipse.runtime.properties.impl.ProjectPropertiesManagerImpl.loadProjectProperties(Unknown Source)
at net.sourceforge.pmd.eclipse.plugin.PMDPlugin.loadProjectProperties(Unknown Source)
... 4 more





I tried reinstalling the plugin, code clean up, etc. But still the problem is not resolved,

Can any one please help.

Sorry Will, please assume "i" is declared outside of try block.
@Vijay - Thanks for the reply vijay.

P.S : More preference is given to finally than the return statement.
12 years ago
Return Statement: - The last control statement in a method is return. It causes program control to transfer back to the caller of the method. It immediately terminates the method in which it is executed.

Finally: - The finally block always executes when the try block exits. This ensures that the finally block is executed even if an unexpected exception occurs.

But in the below code, even though the compiler hits the return statement in catch block the control immediately does not go back to the caller function. It executes finally block, increments i and then the return happens from the finally block. So the returned output for "i" is 2.



1)Why the control does not go back to caller function as soon as it hits return in catch block.
2)Is return behaving differently in "try catch finally" conditions?
12 years ago
That makes the statement complete and perfect , , Thanks Campbell.
12 years ago
To create object we need constructor, In constructor first line sould be call to any super class constructor.
12 years ago
Constructors are not inherited.
First line of a constructor is the call to its superclass constructor.
Eg:
Let's consider class "A" which does not have any default constructor.


Consider another class named "B" which extends "A",



At this point we will get a compilation error asking us to add constructor in Class "B". "Implicit super constructor A() is undefined for default constructor. Must define an explicit constructor".

The reason we get this message is , Class "B" has only one constructor, i.e. the default constructor supplied by the compiler. Like below,



Because Class "A" does not have empty constructor, the call inside Class "B" default constructor is not correct.
That is why we get a message to create constructor explicitly in class "B".

We can solve this issue in two ways,
1) Add default constructor in Class "A". So we can instantiate Class "B" only like,

2) Add either one parameterized constructor in Class "B" or both
i.e.


So we can instantiate Class "B" only like,

Because Class "B" does not have any default constructor, we cannot instantiate Class B like,

Please let me know if my understanding is correct. Thanks
12 years ago

Hi ,

In the below mentioned JavaMemoryPuzzle class, in the function "f" the byte array variable(data) is initialized to maximum amount of runtime memory(not actually maximum memory, i dont know why the multiplication by 0.6 is made).It is block variable so once it comes out of the block its scope should vanish and the memory occupied should be garbage collected because in the next line after that we are using another byte array variable(data2) and assigning the same amount of memory. But when we run this program am getting "Exception in thread "main" java.lang.OutOfMemoryError: Java heap space".




When decompiled the class file of the above code,we get the stack flow structure of the function as shown below

Here i need to know what is happening in the above stack flow. what is mean by "aload_0","astore_1" and after making a small change to the above code no error was there,


The stack flow for the above code is shown below

How does it make difference by creating the data2 variable and assign it to null then using it.
14 years ago