Sarath Chandra

Greenhorn
+ Follow
since Jan 31, 2007
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
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Sarath Chandra

Hi all,

Our requirement is like this

We need to validate and externals sites URL ,based on the return value if the URL is active or not we have to perform some logic in JSP.This jsp page doesnt have any <form>'s and it is been included in some other jsp.

So to perform the logic we failed using java method as it is giving "UNKnownHostException".
So we have used AJAX to perform the URL validation function.we have placed the AJAX function in the same JSP.
Here the problem is even before the AJAX completes validating the URL,the JSP logic gets completed.We have tried with synchrounous ajax call but,doesnt work out for us.We need a way to achieve this,please provide your suggestions.

We appreciate your help.

Thanks in advance,
Sarath
[ September 27, 2008: Message edited by: Sarath Chandra ]
13 years ago
JSP
Thanks Ernest,

As i mentioned earlier i profiled the application using jProfile(i didnt profiled but i have some snapshots of application),as per HotSpots shown by Jprofiler lot of char[] and String live objects (almost 50% of char[]&string live objects)are from java.io.ObjectInputStream.readObject and java.io.ObjectOutputStream.WriteObject of Clone method mentioned above.

So making bstream and other objects in the Clone method as null reference will make these objects to be garbage collected freequently?

Thanks,
Sarath
13 years ago
Hi Marco,

Originally posted by Marco Ehrentreich:
depends very much on the kind of objects you try to clone here.
Marco



Here is the actual object



And the calling method is
13 years ago
Hi,
Ok,Thank you.I will take a note of your valuble suggestions.

Here is antoher method which jprofiler is showing as hotspot



Is this method is same as Object clone or is there any other differences.

Thanks,
Sarath
13 years ago

Originally posted by Paul Clapham:
You might even find there's a performance improvement if you just replace all that code by a call to the URLEncoder.encode method.



Hi all,
Thanks for you suggestions.
Above method that i have posted is taken from one our utilities.
When i tried profile our application using Jprofile(just learning ) ,lot of String instance of this method are alive.

Previously i thought just as Marco Ehrentreich said since these are local variables and only exists untill the method exits.So i just want to be clear on that.

Ernest Friedman-Hill :
I tried with private static string declarion but couldnt find much time differnce for method execution.

if we make the same method as private instead of static and with and without making strings as null reference does all these methods be same performance wise?

Thanks,
Sarath
[ April 02, 2008: Message edited by: Sarath Chandra ]
13 years ago
Hi,

If in a static method 2 strings are created for temp caluclations.Before exiting the method these temparory string variables hasnt been made as null reference. This method has been called number of times.Then will it have any impact on performace.

i tried to calculate the time for this method and the method with strings made as null and with a private method,But not much differnce for these 3 methods even with 10000000 number loops .Will it have any impact on memory usage.Pleae tell me how exactly i can get the details about memory usage.I tried using gc option but couldnt get much help.

Below is the sample method.

13 years ago
Hi again!

Utility is running fine now.

Yes, root cause is OutOfMemory,all those exceptions mentioned above are coming after this error.

Since it is AIX os along with java -Xmx1200m we need to set the environment variable to LDR_CNTRL=MAXDATA=0x40000000

More can be found at http://www.ibm.com/developerworks/systems/articles/aix4java1.html

Thanks Once again all of you for your suggestions!

Sarath
13 years ago
Hi all,

Yes,utility is quitting with outofmemory error on the console.

However when we look in to heapdump and javacore files generated , along with OutOfMemory error there are lot of other exceptions being thrown like MalformedURLException, InterruptedException, IndexOutOfBoundsException ,StringIndexOutOfBoundsException, IllegalArgumentException.

We ran the utility again with java -Xmx1024m but even that is also failed.
Is there any other configuration settings that need to be made?

Thanks,
Sarath
13 years ago
Hi,

Thanks for reply.
Small typo correction might be useful for others.

java -Xmx1024m myClass.class instead of java -xMX1024m myClass.class

Is this same for AIX os also?Could you see any other possibilities for failure of utility?

Thanks.
13 years ago
Hi all,

No success again!Same problem occurs again.

Like i mentioned earlier environment is AIX os.We came to know system is generating heapfiles and javacore files.We are yet to recieve those files.

I wonder memory management will be an issue?Since we dont have knowledge on AIX Os somebody please suggest us with what setting can be made to increase the memory heap size? Meanwhile we will google to get some information.

Thanks again.
13 years ago
Thank you for your suggestions,

We have modified the source and waiting for test results with fingers crossed.Will provide you all the updates after i get the results.

Thanks once again.

Sarath
13 years ago
Hi,

No,the LOG statements are in the same order for all other files except one.More over it is not a Multi threaded utilty.

Intresting thing neither closing fo statement is coming nor statements in catch block.

Environment is AIX & jdk1.3.1_08

I wonder not closing fo in finally is the problem???

Please provide us your valuble suggestions.

Thanks
Sarath
13 years ago
Hi

The utilty reads files from repository as bytes and creates a new file on the localsystem.

Below is the sample code.



Utility log is below


After this statements for other files Closing fo & End Method statements are also wriiten in to log.Only for one file it is getting strucked after the statment mentioned above.

After Writing Byte Array the Exception is also not being thrown as log statements doesnt have any statments present in catch block.

In finally method FileOutputStream fo wasnt been closed..Is this could be the reason.We cant test this utility by modifying the source code right way.So we need your suggestions please.

Thanks
[ March 25, 2008: Message edited by: Sarath Chandra ]
13 years ago
I colud able to solve this issue.

Solution is:

All the options provided for jvm.dll should be on the single line.
13 years ago
Hi,

When trying to make Tomcat4.1 as Windows NT servce with jdk1.3.1_08 using the batch file given below



When we run this batch file, intially it gave message like "you are attempting open a file of type 'Application Extenstion"(.dll),and it provided an option open with.
We have opened that application using regsvr32 of window.

Now it is showing message like
"XXX\jvm.dll" was loaded,but the DllRegisterServer entry point was not found. The file cant be registered.

Any help will be appreciated.

Thanks.
13 years ago