Jack Numen

Ranch Hand
+ Follow
since Nov 09, 2011
Jack likes ...
Hibernate Oracle Java
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jack Numen

I am not sure what you meant by oAuth.
After successful authentication inside you are directed to a URL which contains the verifier code.

This redirection can be done in two ways.
1. Re-directing through the response object (OR)
2. Callback like you said.

If its an Ajax call to the server check for the callBack variable inside the Ajax call function.

Now trace the callBack variabel in the Javascript and there goes your URL.

If its not clear please paste your Ajax call code.
9 years ago
This is one of the solution i thought of - staging the session data to DB or a temporary text file. I would give it a try. In order to avoid maximum DB hits i need to send 5 records / rows at a stretch instead of one at a time.

Its a feasible solution and only thing i need to worry is that if the user changes any data in the previous records i need to track those changes and make necessary ammendments to the strategy thereby.

Thanks Tim and Armitage.
9 years ago
I am currently working on a module where huge amount of data needs to be sent to the weblogic server.
The limit on Weblogic-> Server - > Protocols is 10MB.

The huge data is coming when i try to add more than 20 rows to the Ajax request.

There are possible two solutions for this

1) Increase the limit on Weblogic server to 1Gb which might lead to server crash when two or more users are trying to add 100 records at the same time.
2) Send memory in the form of chunks of (length of a row) everytime i add a row. Stor this in session and upon form submission retrive from session. This cannot work if there are more than 20 users doing load testing as increase in session data decreses performance gradually.

Please let me know any solution . I need that data passed to my server without any performance or errors.Currently its showing weblogic.socket.MaxMesssageSizeExceededException and RequestURI too long errors.
9 years ago
Thank you Jay,

That was indeed a clear explanation.


Now the detective is off to find the leak
9 years ago
Hi,

In my application i have two classes which implement EntityBean class.

Container Managed Persistence is achieved through this implementation in the extending classes.

When i have seen snapshot of the Heap Dump this morning i.e after a period of 12 hours of non-usage or applicaiton idle state the object instance still persist and memory is allocated to them instead of getting Garbage collected.

Is this behavior expected of these objects if so how to overcome over-usage of memory by these objects ? .... in order to avoid performance issues or possible memory leaks.
Hi,
I understand the concept of GC and creation of instances.I am actually looking into some performance issues and i came across this instance creation and memory allocation for the same.

Let us suppose that for a single operation around 1MB of data is allocated for creating such instances and practically speaking this happens in my system.

As you go on operating the same instance is created over and over again.

Now if there are 30 users working at that time let us say 30MB of memory is allocated to such instances.

Let us say there is 1Gb of allocated memory and after 1-2 hours most of the memory gets full.

Now the garbage collector will look over if any of the memories are full and does GC and frees the memory.

Here please explain me whether the increase in memory will cause any performance degrade as the Search for a single instance over a large heap will be more time consuming.

If this lead to Performance degrade what are the possible ways of fixing this.

Best Regards,
Jack
9 years ago
Hi,
While monitoring in JVisualVM ....

Whenever i perform any operation in my application Live Bytes of a particular Instance of a class increases by 1000.

Although i perform the same operation everytime it always increases by 100 or 1000.

Is this a memory leak or does these instances increase everytime we perform an operation.

9 years ago
Hi,

I have got some Load Testing / Stress testing issues in my J2EE application.

I am using JVisualVm for detecting any memory leaks in one of the modules.

The following are the steps i used to detect memory leaks. Please correct me if i am not doing it correct.

Step 1 : Initialize Weblogic Server run the Web application
Step 2: Initialize JVisualVM and start Memory Profiliing.
Step 3 : Perform some operations in the related module.
Step 4 : Now take a snapshot of the Memory.
Step 5 : Move on to another module which has completly different Packages or referred classes
Step 6 : Perform some operation and repeat Step 4.
Step 7 : Compare both the snapshots and see if any objects related to first Modules are remaining in the second Snapshot.
Step 8 : If there are no objects / their allocations then there is no memory leak.

Are these steps correct ?

Now if i found a memory leak then how to trace which method in that class or which object in that class is creating the issue?
9 years ago
How do we cache objects in EJB 2.

My requirement is i need to get data from the database for the first time and retain in cache it throughout the application life.

Regards,
Jacen
Hi,

There are few modules in our application whose performance degrade with time when 50-100 simultaneous users are working on them at a given instance.
The memory allocations are taken care of to allow maximum data.

My issue to where to start finding the root cause.

I am currenlty using JvisualVM for profiling and finding memory leaks

Do i need to Simualte 50-100 virtual users and start finding the memory leaks with JvisualVM or working with a single user would do ?

Best Regards,
Jacen
9 years ago
Please google such small things as many links are available at a click. Ex : http://www.tutorialspoint.com/jdbc/jdbc-db-connections.htm
Thanks ,

I understand that we can use either a UNION or a stored procedure,also saving the trips to the DB might not be expensive.
I have also got the idea of using a multi-dimensional view(CUBE- thereotically speaking) to make my data retrival faster.
My record structure varies for all the queries.Its something more like different tables

(USER_DETAILS,USER_LOCATION,USER_PASSPORT_DETAILS,USER_BANK_DETAILS,BANK_LOC_DETAILS,BANK_RATING,
USER_DEPENDANT_DETAILS,USER_INSURANCE_DETAILS,USER_ESTATE_PROPERTIES and so on)

Each of these details needs to be shown in different tabs fetching all at once.
After Query tuning i found no major difference in performance.
That is the reason why i thought of querying all of them either in a Single shot OR Creating a VIEW(for faster retrival of each table individually).
I need to find the best way to increase performance in this case.
How can i reduce the number of calls to the Database when i am having nearly 10-20 different sql SELECT statements to execute.
Do we have a solution where we can hit the DB only once and fetch all the ResultSets for all these SELECT statements instead of writing PreparedStatements individually and executing them everytime.
Dear Stuart and William..
Thanks for your responses. Yes i agree with you both at some level, lets us say when we are inserting 10-50 records into the Database using our piece of code which has many such conditional checks and iterations. What if there are 100 more records to insert at the same instance checking and validating each item in the record.

I agree that JVM does optimization on the fly and have also answered some queries related to optimisation stuff. In My case with such a piece of code i can insert 10-50 records in less than 15secs but when it comes to 100 more records like this it will(and is) definetly take 2-3mins for such insertions.

Although 2-3ms is not a matter for 10 records but when multiple by 10 then there is difference.
10 years ago
Emphasis is on increasing performance by avoiding null Check and using a boolean in place of every null check.

I have a condition where there is a need to check whether the variable(Collection of some Form variables) is null or not,as the variable is not mandatory everytime.
So i need to do null check everytime.

My Doubt is which one is better among these two code snippets



Or



I know i can use a single if for null check but here that is not the case.

Which one is better method call or temp variable (boolean for null check) lookup?
10 years ago