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

Dennis Gove edited comment on SOLR-7475 at 11/21/15 4:22 AM:
-------------------------------------------------------------

The value is being returned by LukeRequestHandler.java. The pertinent function 
is below

{code}
  /** Returns the sum of RAM bytes used by each segment */
  private static long getIndexHeapUsed(DirectoryReader reader) {
    long indexHeapRamBytesUsed = 0;
    for(LeafReaderContext leafReaderContext : reader.leaves()) {
      LeafReader leafReader = leafReaderContext.reader();
      if (leafReader instanceof SegmentReader) {
        indexHeapRamBytesUsed += ((SegmentReader) leafReader).ramBytesUsed();
      } else {
        // Not supported for any reader that is not a SegmentReader
        return -1;
      }
    }
    return indexHeapRamBytesUsed;
  }
{code}

This claims that returning the ram used is only supported by a SegmentReader 
but that function is actually implemented in CodecReader and is declared in the 
interface Accountable. I suspect this instanceof check can be changed to look 
for the Accountable interface.

That said, the reader in this case is an ExitableDirectoryReader which does not 
implement the Accountable interface. 


was (Author: dpgove):
The value is being returned by LukeRequestHandler.java. The pertinent function 
is below

{code}
  /** Returns the sum of RAM bytes used by each segment */
  private static long getIndexHeapUsed(DirectoryReader reader) {
    long indexHeapRamBytesUsed = 0;
    for(LeafReaderContext leafReaderContext : reader.leaves()) {
      LeafReader leafReader = leafReaderContext.reader();
      if (leafReader instanceof SegmentReader) {
        indexHeapRamBytesUsed += ((SegmentReader) leafReader).ramBytesUsed();
      } else {
        // Not supported for any reader that is not a SegmentReader
        return -1;
      }
    }
    return indexHeapRamBytesUsed;
  }
{code}

This claims that returning the ram used is only supported by a SegmentReader 
but that function is actually implemented in CodecReader and is declared in the 
interface Accountable. I suspect this instanceof check can be changed to look 
for the Accountable interface.

> Value of Heap Memory Usage display
> ----------------------------------
>
>                 Key: SOLR-7475
>                 URL: https://issues.apache.org/jira/browse/SOLR-7475
>             Project: Solr
>          Issue Type: Bug
>          Components: UI, web gui
>    Affects Versions: 5.0
>         Environment: Windows 7 operating system, Solr-5.0, zookeeper-3.4.6
>            Reporter: Yeo Zheng Lin
>              Labels: memory, solr, ui
>         Attachments: Heap Memory Usage.png
>
>
> In the Solr-5.0 admin UI, select a collection, click on Overview. This will 
> show the statistics of the collection. 
> For the Heap Memory Usage, it is showing the value -1 instead of the Heap 
> Memory Usage for that collection. It was said to be working on the previous 
> versions of Solr, and in version 5.0 it was showing -1.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to