Abstract Adequate allocation of buffers in transfer lines is crucial to the optimization of line throughput and work in process (WIP) inventory. Their optimal allocation is subject to specific constraints, associated costs, and revenue projections. In this paper, we implement a combined artificial immune system optimization algorithm in conjunction with a decomposition method to optimally allocate buffers in transfer lines. The aim of the buffer allocation problem (BAP) is to achieve optimal system performance under buffers space constraints. Maximizing line throughput does not necessarily achieve maximum profit. In this study the immune decomposition algorithm (IDA) is used to determine optimal buffer allocation for maximum line throughput and maximum line economic profit. Results of extensive series of tests carried out to compare, in production lines with different characteristics, the performances of the proposed method and those of other algorithms are presented.