Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Memory Leak issue

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Eveyone,

Can you please give me solution for this issue,

In my application i used Tomcat, JSF framework, Hibernate, MySQL.

In JSF RichFramework and Myfaces

I am rendering values lot of places.

Some times queries also triggering twise.

We are getting memory leak issues in the application, because of this application also very slow.

So please any one guide me how can i solve this issue.

Waiting for reply.
 
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you need to do a profiling for your application to identified the bottleneck.

this way, it will give you an idea of where, and what causing the problems.

cheers!
 
Viswas majrekar
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply....

Can you suggest me any one best profiler...

If you have any URL with you, can you please share with me...

If possible explain the steps

Thanks
 
Daniel Jabonete
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

The profiling tools depends in your IDE.

Netbeans has its own profiling, might want ot check out the NetBeans website for the instructions.

Eclipse also has a lot of profiling tools plugins, might want to checkout the particular plugin that might suites you.

Cheers!
 
Viswas majrekar
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks once again..

I am rendering values in lot of places.

for that i am using <a4j:commandbutton>'s and for rendering(reRender attribute).

Actually what i observed is here query is executing more than one time..

how can i restrict this?

Thanks in advance
 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hold the records, of the query, possible in the List by defining a variable in the page bean.
Now, in the getter of this variable just add a null check to verify that call the query method if list is not initialized.

private List<O> records;

public List<O> getRecords (){
if(records == null){
records = /call the query method.
}
}

Actually, my faces table calls value attribute twice in Apply Request and Update Model phase. The above will solve your problem.
Also, in order to refresh records you need to again set records = null in the actions of buttons so that new data will be picked after the action.
 
Saloon Keeper
Posts: 22520
151
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Rajneesh Kumar Rajput wrote:Hold the records, of the query, possible in the List by defining a variable in the page bean.
Now, in the getter of this variable just add a null check to verify that call the query method if list is not initialized.

private List<O> records;

public List<O> getRecords (){
if(records == null){
records = /call the query method.
}
}

Actually, my faces table calls value attribute twice in Apply Request and Update Model phase. The above will solve your problem.
Also, in order to refresh records you need to again set records = null in the actions of buttons so that new data will be picked after the action.



You may find that the getRecords method gets called more than twice, for that matter. As a general rule, if at all possible, avoid doing things that have side-effects in the setter/getter methods of a bean. It's also a good idea for performance reasons.
 
reply
    Bookmark Topic Watch Topic
  • New Topic