The proper configuration of a metaheuristic requires specific and advanced knowledge, for instance to decide an appropriate population size, to effectively set probability parameters, or to define a correct termination criterion. During the last years there is a trend to let the metaheuristic to autonomously self-control the internal configuration. In this way, by using learning mechanisms, the algorithm is able to learn from the solving process and automatically adapt its configuration in order to improve their performance. Following this research trend, in this paper we explore the ability to autonomously predict population size and termination criteria. The population prediction allows the metaheuristic to dynamically vary the population size during solving time. In this regard, a suitable number of agents is used for each part of the process in order to efficiently explore the space of solutions. On the other hand, predicting the termination criteria is useful as well, the smart usage of resources in the optimization field can bring several advantages in solving complex industrial problems. In this regard, since the number of iterations is estimated during solving time, the proposed architecture avoids useless processing time that does not lead to any solution improvement. We illustrate interesting results using the spotted hyena optimizer and crow search algorithm solving 24 benchmarks functions and the multidimensional knapsack problem, where the proposed approach notably competes with several state-of-the-art optimization algorithms.