mahout-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From 施伟伟 <>
Subject deadlock in FastByIDMap.find() ?
Date Fri, 04 Dec 2009 10:14:14 GMT

I found my application based on mahout using 99% CPU after load testing.
There is no actual requests at the moment but the CPU usage kept high.
I generated several thread dump and found one thread may be get stuck an
endless loop in FastByIDMap.find().
I am not sure what is the problem is. I am using customized data model
implemented by myself. It is more or less the same as FileDataModel but
reading data from a different data source.
Please find the detailed info below.


  private int find(long key) {
    int theHashCode = (int) key & 0x7FFFFFFF; // make sure it's positive
    long[] keys = this.keys;
    int hashSize = keys.length;
    int jump = 1 + theHashCode % (hashSize - 2);
    int index = theHashCode % hashSize;
    long currentKey = keys[index];
    while (currentKey != NULL && (currentKey == REMOVED || key !=
currentKey)) {
      if (index < jump) {
        index += hashSize - jump;
      } else {
        index -= jump;
      currentKey = keys[index];
    return index;

Below is the thread dump.

This is the thread that got the lock in
"http-" daemon prio=1 tid=0x085bb618
nid=0x4f5f runnable [0x825a8000..0x825a8f30]
    - locked <0x96eadf98> (a

This is the thread that is blocked in There are hundreds of such
threads in my thread dump file.
"http-" daemon prio=1 tid=0x08405d78
nid=0x5479 waiting for monitor entry [0x731ef000..0x731f0130]
    - waiting to lock <0x96eadf98> (a

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message