• 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

Proxying Objects Causes OutOfMemoryError

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have retrieving my Object instances from a class with a method called getProxy. That method adds InvocationHandlers to extract out logic like tracing logic. Inside my TracingInvocationHandler, I print a statement before a method is executed and one after. I am able to run this fine through some functionality, but other methods cause an OutOfMemoryError. Those methods may create massive size lists within them...would this cause a problem? Is the Proxy to slow in performance to use it to do this?




Thanks for your help,

-jay
 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The massive size lists created by your methods must certainly
consuming memory, but the Proxy code does not seem to be related
to them.

You can try
- Commenting out the logging statements and check how it works.
- Commenting out your DateTime class.

Another suggestion is to implement a static method DateTime.getCurrentTime()
so you dont create two new DateTime instances for each method invocation.

Finally, are you caching your java.lang.reflect.Method instances ?
i.e how do you pass the Method object to the proxy class's invoke
method.

Hope this helps,
Ajay
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic