On 04/14/16 at 01:42pm, Zhou Wenjian wrote: > @@ -10223,6 +10263,20 @@ calculate_cyclic_buffer_size(void) { > * free memory for safety. > */ > limit_size = get_free_memory_size() * 0.6; > + > + /* > + * Recalculate the limit_size according to num_threads. > + * And reset num_threads if there is not enough memory. > + */ > + if (limit_size - maximum_size < THREAD_REGION * info->num_threads) { > + MSG("There isn't enough memory for %d threads.\n", info->num_threads); > + > + info->num_threads = MAX(0, limit_size - maximum_size) / THREAD_REGION; Hi, Zhou. Since both limit_size and maximum_size are unsigned long long, comparison is necessary for the if branch. Thus the micro MAX can be removed as well. Thanks Minfei