In Eclipse MAT's OQL: how to construct a date from a long integer?

678 views Asked by At

I'm doing some investigation in a core dump via Eclipse MAT. I've got some OQL that gets me pretty close to the information I want about web client sessions that haven't been collected (and are holding onto a LOT of memory).

The session data has a date, in long integer format.

This is a small thing (or should be) but I've not figured out how to convert that long integer into a meaningful date object inside the OQL, but doing so would help me filter the harmless live sessions from the potential leaks.

So, what is the trick for converting long to date or timestamp in MAT's OQL?

1

There are 1 answers

1
rafalopez79 On

As an alternative to MAT you can use visualvm

JavaScript expressions can be used as a filter in an OQL query, in your case to restrict all the sessions to the meaningful ones.

For instance:

select o  from java.util.Date o 
   where new java.util.Date(o.fastTime).getYear() > 114 
      && new java.util.Date(o.fastTime).getMonth() == 7

I Hope this could help you.