After "optimizing" the VM the file grows (in my case from 13 GB to 100 GB, which is the maximum size of the dynamic disk)

Workaround:

Create a full clone of your VM (this copies all the linked disks + your VM into a target disk). You are not using the base disks from that moment on. But the resulting VM will be nice and small and in the future you can use PerfectDisk again to optimize and shrink your VM.