Source:
<code>private void checkThreadsSanity() { int tableCount = m_catalogContext.tables.size(); int hostcount = m_config.m_hostCount; int partitions = m_iv2Initiators.size() - 1; int replicates = m_configuredReplicationFactor; int importPartitions = ImportManager.getPartitionsCount(); int exportTableCount = ExportManager.instance().getExportTablesCount(); int exportNonceCount = ExportManager.instance().getConnCount(); int expThreadsCount = computeThreadsCount(tableCount, partitions, replicates, importPartitions, exportTableCount, exportNonceCount, hostcount); String[] command = {"bash", "-c" ,"ulimit -u"}; String cmd_rst = ShellTools.local_cmd(command); int maxThreadsCount = 0; try { maxThreadsCount = Integer.parseInt(cmd_rst.substring(0, cmd_rst.length() - 1)); } catch(Exception e) { maxThreadsCount = Integer.MAX_VALUE; <START> } <END> if (maxThreadsCount < expThreadsCount) { StringBuilder builder = new StringBuilder(); builder.append(String.format("The configuration of %d tables, %d partitions, %d replicates \n", tableCount, partitions, replicates)); builder.append(String.format("with importer configuration of %d importer partitions \n", importPartitions)); builder.append(String.format("with exporter configuration of %d export tables %d partitions %d replicates \n", exportTableCount, partitions, replicates)); builder.append(String.format("The maximum number of threads to the system is %d", maxThreadsCount)); builder.append("Please increase the maximum system threads number or reduce the number of threads in your program, and then restart VoltDB."); consoleLog.warn(builder.toString()); } }</code><technical_language>need do the" bash ulimit" time change frequently. cache start update hour. a ResourceUsageMonitor.java for monitoring memory usage</technical_language>

Target:
private void checkThreadsSanity() { int tableCount = m_catalogContext.tables.size(); int partitions = m_iv2Initiators.size() - 1; int replicates = m_configuredReplicationFactor; int importPartitions = ImportManager.getPartitionsCount(); int exportTableCount = ExportManager.instance().getExportTablesCount(); int exportNonceCount = ExportManager.instance().getConnCount(); int expThreadsCount = computeThreadsCount(tableCount, partitions, replicates, importPartitions, exportTableCount, exportNonceCount); if (m_maxThreadsCount < expThreadsCount) { updateMaxThreadsLimit(); } if (m_maxThreadsCount < expThreadsCount) { StringBuilder builder = new StringBuilder(); builder.append(String.format("The configuration of %d tables, %d partitions, %d replicates, ", tableCount, partitions, replicates)); builder.append(String.format("with importer configuration of %d importer partitions, ", importPartitions)); builder.append(String.format("with exporter configuration of %d export tables %d partitions %d replicates, ", exportTableCount, partitions, replicates)); builder.append(String.format("approximately requires %d threads.", expThreadsCount)); builder.append(String.format("The maximum number of threads to the system is %d. \n", m_maxThreadsCount)); builder.append("Please increase the maximum system threads number or reduce the number of threads in your program, and then restart VoltDB. \n"); consoleLog.warn(builder.toString()); } }