The invention discloses a
garbage collection method for a
solid state disk in the technical field of
solid state disks, which comprises the following steps: S1, monitoring freevb in real time, and triggering GC when the freevb reaches a threshold value; s2, if the number of newly added nodes is larger than or equal to thres1, or the number of newly added ST2 vb is larger than or equal to thres2, or vb in source vb
pool is exhausted, executing S3, otherwise, executing S4; s3, establishing a source vb
pool (Source vb
pool); s4, the source vb is selected from the source vb pool, and the source vb is selected from the source vb pool; s5, a target vb is created; s6, effective data are recorded; s7, moving effective data; s8, updating the L2P mapping relation; s9, the source vb is released; and S10, updating the vblist. According to the
garbage collection method, the time for establishing the source vb pool is controlled through the threshold value, and the writing performance of the
solid state disk is improved by reducing the frequency for establishing the source vb pool, shortening the GC time consumption and improving the GC efficiency.