[ 
https://issues.apache.org/jira/browse/GIRAPH-842?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14025989#comment-14025989
 ] 

Sergey Edunov commented on GIRAPH-842:
--------------------------------------

Hey Pavan, this is great feature, here are some comments on implementation:

1) Please assign your thread some meaningful name, it can be helpful in 
debugging stack traces.
2) Stop flag has to be volatile, otherwise your thread may never see the change
3) I would let the thread die if you get InterruptedException.
4) runtime.freeMemory() might give you false alarms if you run job with 
different values of Xmx and Xms. This is because freeMemory only counts free 
bytes currently allocated to JVM. If your Xmx setting is bigger than Xms you 
can go low on freeMemory before JVM allocates another chunk. To get more 
accurate results you can do (maxMemory - totalMemory + freeMemory) 

> option to dump histogram of memory usage when heap is low on memory
> -------------------------------------------------------------------
>
>                 Key: GIRAPH-842
>                 URL: https://issues.apache.org/jira/browse/GIRAPH-842
>             Project: Giraph
>          Issue Type: Bug
>            Reporter: Pavan Kumar
>            Assignee: Pavan Kumar
>            Priority: Minor
>         Attachments: GIRAPH-842.patch, master-stderr, worker-stderr
>
>
> Currently we are left in blind for jobs that OOM, it would be helpful if we 
> can do a jmap -histo dump when heap has very little free space left.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to