• 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
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

object pooling

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

we can store the objects in weblogic server by using binding.

Now how can the object pooling improve the performance of an application.

Is it similar to connection pooling which can improve the performance in case of database connection.

Appreciate any replies.
 
Ranch Hand
Posts: 641
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I guess yes .

Here is a scenrio where you need to use the URL connection object on every thread acess . Now the best way to do this would be to reuse the connection objects from a pool of such objects.

Hope this helps.
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by raghav mathur:

Here is a scenrio where you need to use the URL connection object on every thread acess . Now the best way to do this would be to reuse the connection objects from a pool of such objects.



Bad example. The JVM keeps HTTP connections alive by default: JDK 1.5.0 Release Notes. It is a bad idea to "guess" about performance without knowing what the JVM is doing because you could end up making your application perform worse because your assumptions are wrong:


7.6.1 Object Pooling
. . .with the new generation of JVM implementations that include advanced memory management systems, object pooling small objects is often counterproductive. The overhead of managing the object pool is often greater than the small object penalty. Pooling can also increase a program's memory footprint. The need for many of these small objects can often be avoided altogether by having control over object mutability. Pooling small objects is not a recommended tactic when you're working with the new generation of JVMs.



http://java.sun.com/docs/books/performance/1st_edition/html/JPMutability.fm.html#11379

The first rule of optimization is "don't do it". "Premature optimization is the root of all evil".
The second rule is benchmark, test, then benchmark again. The Java Platform Performance book above is an excellent resource for learning how.
[ August 29, 2006: Message edited by: Joe Ess ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic