Several sampling approaches have been proposed in literature for the analysis of ow lines with stochastic processing times and finite buffer capacities. The system's performance can be evaluated by a linear programming formulation if the number of buffers between the stations is given. This work presents several mixed integer programming approaches to optimize the buffer allocation in ow lines with stochastic processing times. Sampling is used to represent the random processing times. The objective is to minimize the overall number of buffer spaces obtaining at least a given goal production rate. Numerical experiments are carried out to evaluate different sampling approaches and model formulations. These approaches are compared ...