• 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
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Bulky Objects !

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

When can I say a object to be heavy / bulky ?

I feel a particular type of objects in my application are bulky and it would be useful to make a object pool for those objects.But what would be the criteria of a heavy object ? Or ,When can I say a object to be bulky ?

I am saying those objects to be bulky as those are close to 2k lines of code.Is there is any formal defination of heavy objects apart from lines of source code , like number of variables , depth of inheritence etc.
 
Sheriff
Posts: 28417
102
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why not back up and consider your original question: What types of objects should you use a pool for?

In my opinion you should use a pool for a type of object when that type of object uses a lot of some kind of resource, so that creating large numbers of it would stress the system.

So in real life you have thread pools, because a thread consumes system resources and you don't want to create too many of them. Similarly with database connections.

I don't see any of those source code metrics you suggested as being of any use in answering this question.
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Paul , its a great deal of information.
So I think there is no need to implement a object pool for these object.These classes might be large in size but do not consume much of resources.

Thanks once again.
 
Bartender
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

These classes might be large in size but do not consume much of resources.



Perhaps you can flyweight it then ?
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by John Meyers:


Perhaps you can flyweight it then ?



Thanks John.I have already evaluated flyweight , but will not be suitable for my application.

I just need to make an object pool provided I can find out as how much time does it take to instantiate the object of the class that is under consideration.Doing some timer testes to find out as how much time does it take to instantiate the object and how much time will I gain by using a object pool.

Any web pointers on Heavy objects would be appreciated.
Thanks,
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic