Re: [jetty-users] memory leak in jetty monitor ?

2021-09-16 Thread Greg Wilkins
Ivan,

Wow, jetty-7 isn't just old, it is ancient!

It could be the problem found/fixed in 2015 :
https://bugs.eclipse.org/bugs/show_bug.cgi?id=484822
But jetty-monitor isn't even part of Jetty any more.

So sorry, we can't offer you much support on this one.   But the beauty of
open source is that you are free to find/fix the issue yourself.  Do tell
us how you go.

cheers



On Sat, 11 Sept 2021 at 04:04, Ivan 163  wrote:

> Hi,
> We are using jetty-monitor to print the thread usage, which following
> the configurations on the link [1]. After running the jetty server for a
> while, we found that tons of EventState instances, which were held by the
> _states variable in the AttrEventTrigger. We are trying to dive into the
> monitor the codes, it seems that the issue is that, the thread status
> retrieved from the mbean server  are saved in the _states map in the match
> method, but there is no remove action is invoked. So is it possible an
> issue here ?
>Although the jetty version we used is an very old one 7.6.7, it seems
> that no code is changed in the lastest 9.x version.
>
> *public* *final* *boolean* match(*long* timestamp)
>
> *throws* Exception
>
>   {
>
> MBeanServerConnection serverConnection = JMXMonitor.
> getServiceConnection();
>
>
>
> TYPE value = *null*;
>
> *try*
>
> {
>
>   *int* pos = *this*._attributeName.indexOf('.');
>
>   *if* (pos < 0) {
>
> value = (Comparable)serverConnection.getAttribute(*this*.
> _nameObject, *this*._attributeName);
>
>   } *else* {
>
> value = getValue((CompositeData)serverConnection.getAttribute(
> *this*._nameObject, *this*._attributeName.substring(0, pos)), *this*.
> _attributeName
>
>   .substring(pos + 1));
>
>   }
>
> }
>
> *catch* (Exception ex)
>
> {
>
>   LOG.debug(ex);
>
> }
>
> *boolean* result = *false*;
>
> *if* (value != *null*)
>
> {
>
>   result = match(value);
>
>   *if* ((result) || (getSaveAll())) {
>
> *this*._states.put(Long.valueOf(timestamp), *new* EventState(
>
>   getID(), getNameString(), value));
>
>   }
>
> }
>
> *return* result;
>
>   }
>
> [1]
> https://wiki.eclipse.org/Jetty/Reference/jetty-monitor#Starting_the_In-process_Monitor
>
>
>
> ___
> jetty-users mailing list
> jetty-users@eclipse.org
> To unsubscribe from this list, visit
> https://www.eclipse.org/mailman/listinfo/jetty-users
>


-- 
Greg Wilkins  CTO http://webtide.com
___
jetty-users mailing list
jetty-users@eclipse.org
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/jetty-users


[jetty-users] memory leak in jetty monitor ?

2021-09-10 Thread Ivan 163
Hi,
We are using jetty-monitor to print the thread usage, which following the 
configurations on the link [1]. After running the jetty server for a while, we 
found that tons of EventState instances, which were held by the _states 
variable in the AttrEventTrigger. We are trying to dive into the monitor the 
codes, it seems that the issue is that, the thread status retrieved from the 
mbean server  are saved in the _states map in the match method, but there is no 
remove action is invoked. So is it possible an issue here ?
   Although the jetty version we used is an very old one 7.6.7, it seems that 
no code is changed in the lastest 9.x version.



publicfinalbooleanmatch(longtimestamp)

throwsException

  {

MBeanServerConnection serverConnection = JMXMonitor.getServiceConnection();



TYPE value = null;

try

{

  intpos = this._attributeName.indexOf('.');

  if(pos < 0) {

value = (Comparable)serverConnection.getAttribute(this._nameObject, 
this._attributeName);

  } else{

value = 
getValue((CompositeData)serverConnection.getAttribute(this._nameObject, 
this._attributeName.substring(0, pos)), this._attributeName

  .substring(pos + 1));

  }

}

catch(Exception ex)

{

  LOG.debug(ex);

}

booleanresult = false;

if(value != null)

{

  result = match(value);

  if((result) || (getSaveAll())) {

this._states.put(Long.valueOf(timestamp), newEventState(

  getID(), getNameString(), value));

  }

}

returnresult;

  }



[1] 
https://wiki.eclipse.org/Jetty/Reference/jetty-monitor#Starting_the_In-process_Monitor___
jetty-users mailing list
jetty-users@eclipse.org
To unsubscribe from this list, visit 
https://www.eclipse.org/mailman/listinfo/jetty-users