2

Screenshots of the call tree and hot spots in the CPU View when profiling my application are given below. Can I say that cglib's MethodInterceptor.intercept() is a hotspot? It's not code that I wrote or even calling it directly, it's grails internal call. If yes, how do I fix it?

I know I should generally be looking at only the "Runnable" thread status. But, this only shows as a hotspot when the thread status is set to "Waiting" or "All States". Does that mean intercept() is waiting for some event to occur? How come it's this same method that's waiting in all the flows? And how to fix this issue?

Call Tree:

Hot Spots:

Anand Jayabalan
  • 12,294
  • 5
  • 41
  • 52
  • If I'm not mistaken is the proxy that call your real service method. The proxy is created to wrap your service method in a transaction. –  May 14 '13 at 00:37
  • I don't understand how 59 invocations of OrderService.pay() takes 1570s and inside the tree the same 59 invocations of OrderService.pay() takes 7101ms. What parameters do I adjust in the web server or the app, so that there is no waiting or atleast less waiting? – Anand Jayabalan May 14 '13 at 00:57
  • 2
    There are non-profiled classes between MethodInterceptor and OrderService. Try to switch to "Sampling" and disable all filters, then look at the hot spots view again. – Ingo Kegel May 14 '13 at 07:43
  • Thanks a lot, Ingo. Your tip helped me find the problem. By default, all services in Grails are transactional. So, spring framework's transactional classes had been woven into the code and it was waiting on a connection. I don't need many parts of my webapp to be transactional. So, explicitly disabling transactions solved this problem. Thanks again. – Anand Jayabalan May 15 '13 at 03:43
  • @IngoKegel, I'd like to mark your comment as the answer to this question. But unfortunately I don't see an option to do that. Can you please post your comment as the answer to this question, so I can mark it as answered. – Anand Jayabalan May 15 '13 at 03:46

1 Answers1

3

There are non-profiled classes between MethodInterceptor and OrderService. Try to switch to "Sampling" and disable all filters, then look at the hot spots view again.

Ingo Kegel
  • 46,523
  • 10
  • 71
  • 102