Several sampling approaches have been proposed to analyze flow lines with stochastic processing times and finite buffer capacities. If the number of buffers between the stations is given, the system's performance can be evaluated via a linear programming formulation. This work presents several mixed integer programming approaches to optimize the buffer allocation in flow lines with stochastic processing times. The processing times are sampled according to different approaches. The objective is to minimize the overall number of buffer spaces obtaining at least a given goal production rate. Numerical experiments are carried out in order to evaluate different sampling approaches and model formulations. The sampling approaches are compared regarding the robustness of the allocation decision with respect to the sample sizes.