The present invention relates to a foldable retention mechanism, and particularly to a mechanism for retaining a CPU package. A related invention is disclosed in U.S. Pat. No. 5,748,466. Referring to FIG. 1, a conventional retention mechanism has base 2 and two retaining arm members 1 connected to opposite lateral ends of the base 2 by a pair of lugs 21. A guiding slot 11 is defined in each arm 1. A locking member 3 is positioned at a free end of each retaining arm member 1. A CPU package and a heat sink (not shown) can be received between the guiding slots 11. However, the conventional retention mechanism can only accommodate a CPU package and heat sink of fixed thickness. To fulfill the needs of a CPU package and heat sink of different thickness, a corresponding retention mechanism must be provided. Thus, an improved retention mechanism is required which can accommodate different types of CPU packages and heat sinks.