• Post Reply Bookmark Topic Watch Topic
  • New Topic

setting threshold for memory using %  RSS feed

 
roxy alexandre
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
(everything for java5)I am trying to get notification when memory runs low.
For what I understand I have to register a listener to MemoryMXBean and then set a threshold to MemoryPoolMXBean.
How can I know the threshold to set? If I want a notification when 80% of the memory is used. The threshold is only for a pool and not for total memory.
Do I have any chance to get a portable solution ? (not just for sun's java).

Is there an easier solution than using MXBean ?
thanks in advance,
alex
 
D Rog
Ranch Hand
Posts: 472
Linux Objective C Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you look in threshold usage examples on this page? Actually I'm interested too, so I'd like to know if it didn't help.

Edit: regarding easier ways, I think you can use just memory usage polling mechanism (no MXBean). However I am not sure how reliable it is.
[ July 20, 2007: Message edited by: D Rog ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!