With a combination of genetic algorithm and space filling curve (SFC), an optimal design method for production line layout was proposed to minimize the total cost including work in progress (WIP) holding cost, buffer allocation cost and material handling cost in consideration of buffer allocation. A case study of production line for a diesel engine cylinder block was given to verify the availability and advancement of the design.