Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

static int threadNum = 100;

发生OOM,只剩下两个线程活跃,其他线程驻留

实验3:readBufferSize > MaxDirectMemorySize,readBufferSize < maxCachedBufferSize

static long maxCachedBufferSize = 1024 * 1024 * 2;
static int readBufferSize = 1024 * 1024 * 1;

1、单线程,从文件随机读取一段

读取成功,未观测到

2、单线程,从同一个文件不断读取

读取成功,

Image Added

3、循环多线程,从文件随机读取一段

static int threadNum = 5;

读取成功,未观测到

static int threadNum = 100;

成功读取5次后OOM,

Image Added

Image Added


4、循环多线程,从文件不断读取

static int threadNum = 5;

读取成功

Image Added

static int threadNum = 100;

只有5个线程活跃,其他线程休眠,未爆OOM

Image Added

Image Added

5、线程池,从文件随机读取一段

static int threadNum = 5;

读取成功,

Image Added

static int threadNum = 100;

5个线程读取成功后发生OOM

Image Added

Image Added

6、线程池,从文件不断读取

static int threadNum = 5;

读取成功,

Image Added

static int threadNum = 100;

发生OOM,只有五个线程活跃

Image Added


下一步,对参数 TEMP_BUF_POOL_SIZE 进行验证,但现在还没模拟出来。