The code generation process by the optimizing compiler from the intermediate representation based on the control flow graph has been considered. The problem of the linear sections optimal arrangement in the memory has been formulated. The practical algorithm of this problem approximated solution has been described, and its efficiency estimation has been performed.