{"record":{"id":"9dc222c401f4f2c3","repo":"apache/hadoop","slug":"there-is-no-enough-persistent-memory-space-for-cac","errorCode":null,"errorMessage":"There is no enough persistent memory space for caching. The current max available space is ${maxAvailableSpace}, but ${bytesCount}is required.","messagePattern":"There is no enough persistent memory space for caching\\. The current max available space is (.+?), but (.+?)is required\\.","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/PmemVolumeManager.java","lineNumber":414,"sourceCode":"    if (count == 0) {\n      throw new IOException(\"No usable persistent memory is found\");\n    }\n    int k = 0;\n    long maxAvailableSpace = 0L;\n    while (k++ != count) {\n      if (nextIndex == count) {\n        nextIndex = 0;\n      }\n      byte index = nextIndex++;\n      long availableBytes = usedBytesCounts.get(index).getAvailableBytes();\n      if (availableBytes >= bytesCount) {\n        return index;\n      }\n      if (availableBytes > maxAvailableSpace) {\n        maxAvailableSpace = availableBytes;\n      }\n    }\n    throw new IOException(\"There is no enough persistent memory space \" +\n        \"for caching. The current max available space is \" +\n        maxAvailableSpace + \", but \" + bytesCount + \"is required.\");\n  }\n\n  @VisibleForTesting\n  String getVolumeByIndex(Byte index) {\n    return pmemVolumes.get(index);\n  }\n\n  ArrayList<String> getVolumes() {\n    return pmemVolumes;\n  }\n\n  /**\n   * A cache file is named after the corresponding BlockId.\n   * Thus, cache file name can be inferred according to BlockId.\n   */\n  public String idToCacheFileName(ExtendedBlockId key) {","sourceCodeStart":396,"sourceCodeEnd":432,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/PmemVolumeManager.java#L396-L432","documentation":"Error \"There is no enough persistent memory space for caching. The current max available space is ${maxAvailableSpace}, but ${bytesCount}is required.\" thrown in apache/hadoop.","triggerScenarios":"Caching a block to persistent memory when the requested byte count exceeds the maximum available pmem space.","commonSituations":"See trigger scenarios.","solutions":["Free space in the pmem cache (evict cached blocks or clear the cache directories) before caching larger blocks.","Add more or larger pmem volumes to dfs.datanode.pmem.cache.dirs.","Cache smaller blocks or reduce the number of blocks directed to pmem cache."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}