The combustion process has a high impact on the engine efficiency, and in the search for efficient engines it is of interest to study the combustion. Optimization and optimal control theory is used to compute the most efficient combustion profiles for single zone model with heat transfer and crevice effects. A model is first developed and tuned to experimental data, the model is a modification of the well known Gatowski et al.-model . This model is selected since it gives a very good description of the in-cylinder pressure, and thus the produced work, and achieves this with a low computational complexity. This enables an efficient search method that can maximize the work to be developed. First, smooth combustion profiles are studied where the combustion is modeled using the Vibe function, and parametric optimization is used to search for the optimal profile. Then, the most efficient combustion process with a completely free combustion is studied with theory and software for optimal control. A parameter study is performed to analyze the impact of crevice volume and air/fuel ratio λ. The results show that the losses have a high impact on the behavior, which is natural, and that the crevice effect has a very distinct effect on the optimal combustion giving a two mode appearance similar to the Seiliger cycle.