No offense intended, but you are likely mixing up the idea of RAM versus SSD-storage device size. It is very highly unlikely you have a laptop with 128GB of RAM. I would assume you really have a laptop with a total RAM of 16GB (or 8GB) with a 128GB SSD-drive inside, because laptops with even more RAM , also typically come with larger SSD-drive storage drives like 256GB, 512GB, 1TB or higher.
Also, Error 7 is not so much about a specific individual hardware capacity, but rather about how complex and demanding the task at hand. The amount of address space used by the operating system to perform functions on a million people is more intensive upon the RAM and SSD, which have to work in conjunction to process cleanup and compaction.
That means you’d have to split the task down into smaller subsets of people to reduce the demand. So, for example, first do an immediate Backup. Close all other databases, but this problem one. Now, as a test, Create a fresh new RM database, Arrange the two opened database windows side by side and employ Drag n’ Drop to drag Yourself and everybody related to You across to that fresh database. Run the Compact. Does it still error out?
If not, there’s a likelihood You can work on that batch to reduce duplicated events, correct spelling differences in Given and Surnames, merge Place Names, Date mismatches, etc. EITHER back in the original or even in this temporary one. When the reduction starts allowing AutoMerge and Manual Merge to consolidate and still pass Compact, you have an idea whether those things will help the original or whether compacting in the temp database will allow you to shrink it down, followed by a second Drag n’ Drop of a Selection criteria (Group or Color Code) of those that are NOT related to You for the same treatment approach.
OR it doesn’t have to be about “related to You” but rather the first Drag n’ Drop could be Selection criteria for a Group or Color Code of everyone who has EITHER a Parent, a Spouse, or a Child. Trying several isolation approaches to filter down the duplication or reduce the demand (all the while having your Backup intact) may get you past this.
EDIT: Bear in mind that GEDCOM export (with Selection criteria) from this database to a new fresh database can also be an alternative (to Drag n’ Drop) to determine viability of these approaches.