Heap size is 4Gb
Stable memory is 8Gb
If you have pre and post upgrade hooks, keep in mind that during upgrades your canister might do some allocations that can go beyond the 4gig heap limit which will render your canister impossible to upgrade.
There is plan to increase those limitations to 300Gb tho Increased Canister Smart Contract Memory - #117 by claudio
Cheers