A method, comprising: determining a connection sequence of a plurality of algorithm elements (14 -14) in a schematic of a signal flow for an electronic circuit, wherein the connection sequence indicates connections (16 -16) between the algorithm elements (14 -14) and a sequence of processing the algorithm elements (14 -14) according to the connections; determining a buffer sequence indicating an order of using a plurality of memory buffers (24 -24) to process the plurality of algorithm elements (14 -14) according to the connection sequence; and reusing at least some of the plurality of memory buffers (24 -24) according to the buffer sequence; wherein the determining the buffer sequence comprises: constructing a first memory life matrix, MLM, comprising N rows and M columns, wherein N is the number of the algorithm elements (14 -14) using the memory buffers (24 -24), and M is the number of the connections (16 -16), wherein each row is named according to the number of the corresponding algorithm element, and each column is named according to the number of the corresponding connection; arranging the N algorithm elements (14 -14) in an ascending order in the N rows and the M connections in an ascending order in the M columns; for each cell in the first MLM, marking a first symbol if the algorithm element corresponding to the row of the cell generates an output on the connection corresponding to the column of the cell, and marking a second symbol if the algorithm element corresponding to the row of the cell receives an input on the connection corresponding to the column of the cell; and generating a second MLM by rearranging the rows in the first MLM such that in any given column, the first symbol appears before the second symbol. determining a connection sequence of a plurality of algorithm elements (14 -14) in a schematic of a signal flow for an electronic circuit, wherein the connection sequence indicates connections (16 -16) between the algorithm elements (14 -14) and a sequence of processing the algorithm elements (14 -14) according to the connections; determining a buffer sequence indicating an order of using a plurality of memory buffers (24 -24) to process the plurality of algorithm elements (14 -14) according to the connection sequence; and reusing at least some of the plurality of memory buffers (24 -24) according to the buffer sequence; wherein the determining the buffer sequence comprises: constructing a first memory life matrix, MLM, comprising N rows and M columns, wherein N is the number of the algorithm elements (14 -14) using the memory buffers (24 -24), and M is the number of the connections (16 -16), wherein each row is named according to the number of the corresponding algorithm element, and each column is named according to the number of the corresponding connection; arranging the N algorithm elements (14 -14) in an ascending order in the N rows and the M connections in an ascending order in the M columns; for each cell in the first MLM, marking a first symbol if the algorithm element corresponding to the row of the cell generates an output on the connection corresponding to the column of the cell, and marking a second symbol if the algorithm element corresponding to the row of the cell receives an input on the connection corresponding to the column of the cell; and generating a second MLM by rearranging the rows in the first MLM such that in any given column, the first symbol appears before the second symbol. constructing a first memory life matrix, MLM, comprising N rows and M columns, wherein N is the number of the algorithm elements (14 -14) using the memory buffers (24 -24), and M is the number of the connections (16 -16), wherein each row is named according to the number of the corresponding algorithm element, and each column is named according to the number of the corresponding connection; arranging the N algorithm elements (14 -14) in an ascending order in the N rows and the M connections in an ascending order in the M columns; for each cell in the first MLM, marking a first symbol if the algorithm element corresponding to the row of the cell generates an output on the connection corresponding to the column of the cell, and marking a second symbol if the algorithm element corresponding to the row of the cell receives an input on the connection corresponding to the column of the cell; and generating a second MLM by rearranging the rows in the first MLM such that in any given column, the first symbol appears before the second symbol.