The traditional RDH method for JPEG bitstream is conducted by building the mapping between the variable length codes (VLC). However, the capacity is limited, and the file size may not be well preserved as the capacity is increased. This is because that the trade-off between the capacity and the file size has not been deeply investigated, neither explicitly formulated nor appropriately optimized. In this paper, we propose to take the file size preservation into consideration and minimize the file size increase for a given capacity. We use the value transfer matrix to simulate a theoretical model and then design some optimization rules to reach the reversible solution. Consequently, a better reversible VLC mapping can be obtained in terms of both the capacity and the file size preservation. The experimental results show that the proposed method can increase the capacity with a relatively low cost of file size increase.