Nowadays, optimization problems are large-scale and complicated, so heuristic optimization algorithms have become common for solving them. Gravitational Search Algorithm (GSA) is one of the heuristic algorithms for solving optimization problems inspired by Newton's lows of gravity and motion. Definition and calculation of masses in GSA have an impact on the performance of the algorithm. Defining appropriate functions for mass calculation improves the exploitation and exploration power of the algorithm and prevents the algorithm from getting trapped in local optima. In this paper, Sigma scaling and Boltzmann selection functions are examined for mass calculation in GSA. The proposed functions are evaluated on some standard test functions including unimodal functions and multimodal functions. The obtained results are compared with the standard GSA, genetic algorithm, particle swarm optimization algorithm, gravitational particle swarm algorithm and clustered-GSA. Experimental results show that the proposed method outperforms the state-of-the-art optimization algorithms, despite the simplicity of implementation.