• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

performance slows down with increasing memory?

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am working on a performance issue. This is reported in production, so not much debugging is possible. Here application performance degrades over a period of time. This programs runs for 2 hours for processing 10,000 records. The rate of processing is 200 records/minute initially, then it becomes 150 rec/mt, and finally 25 rec/mt after some time. The kind of processing is same for all records. The overall time (2 hrs) is okay at this point, but the concern is on gradual performance degradation.

What I am trying to find out is:

(1) Can this be due to a memory leak? Will the application slow down when the memory increases? (a dump question, but when I tried with a small program that creates lot of data (to the onset of OutofMemoryError), I couldn't verify this fact. Processing time was the same with and without huge data in memory). btw I am using some collections that hold large number of objects (roughly 10,000).

(2) I have seen some code using WeakReference caching. Will that be helpful here? I could verify that this makes the program more memory efficient. (More objects were getting marked for garbage collection when I used WeakReference, verified this using a static counter variable , increment and display this counter in finalize()).

Waiting for your expert opinion, thanks in advance!
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I suggest you monitor the time spent in various parts of the program with something like JAmon (free) or one of the Java profiler products. There is no sense in speculating when you can measure.

It is not clear from your post exactly what kind of processing is going on.
Is your program talking to a database or what?
Bill
 
binu ks
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the suggestion..

The program makes Database calls (in many places).
Also it runs on JBoss.

Will try JAmon. Will I need to plug-in the profiler to JBoss? If so will that be possible?
 
binu ks
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Bill, Pl ignore my previous post(abt JBoss) as I found out later that JMon is used as part of the application
 
William Brogden
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When you finally figure out what was causing your performance problem, please follow up with some details - especially if you find a good solution.

Bill
 
binu ks
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sure!
 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you looked into the availability of database connections with time as how many connections are available in pool?

You can also log the amount of free memory available using "freeMemory()" method in Runtime to actually verify if memory is the issue?

Cheers
Ravindra
 
Ranch Hand
Posts: 862
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The new version of jamon not only allows you to track performance, but the memory your application consumes. You can call the following after processing each row or batch of rows.

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Turn on the different verbose options (like printgcdetails or printtenuringdistribution) for gc and see how frequently it's doing garbage collection and what the pattern. You might find as time passes the frequency increasing due to memory leaks in your application that can cause tons of objects occupying unnecessary heap space. That'll give you an initial idea.
 
Ranch Hand
Posts: 1170
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes memory leaks can cause performance to drop given you have a limited amount of memory. If you want to test this, reduce the amount of memory you give the JVM at runtime, and see how much faster it slows down. If it does not slow down faster (over time) then your problem is not a memory leak.
 
binu ks
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This problem is resolved for now. The application was using Toplink for object/database mapping. For a particular business object, Toplink caching was disabled. I changed Toplink setup to enable caching and the application is performing better now. (before the change, # of records processed per minute:250 -30 . After the fix it is 250-150). For now, this is acceptable to the client. If they come back with this issue later I may have to check memory issues.

I guess I will be reopening this post if the issue returns. Thanks all for your suggestions!
 
Live ordinary life in an extraordinary way. Details embedded in this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic