Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Is this memory leak ?

 
R K Singh
Ranch Hand
Posts: 5388
1
Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Currently I am working on web application.

The scenario is, user logs in to application and execute 3-4 use cases.

Using OptimizeIt, I can see that there are some objects that should be elegible for GC after particular unit case but they are not freed by the program.

If user logs off, at that time, those objects are freed/become eligible for GC

My doubt is, can this scenario be called memory leak?
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you holding references to those objects because you need them. If you dont need them then it is a memory leak.
 
R K Singh
Ranch Hand
Posts: 5388
1
Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Pradip Bhat:
Are you holding references to those objects because you need them. If you dont need them then it is a memory leak.


You are right. It is memory leak.

I had confusion because once user logs off objects are released.

But if 10 users are logged in then there would be objects that would be holding memory without any purpose.

Thanks for confirmation, Pradeep.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!