Cannot construct DataBuffer - RAM usage doesn't go down after error

This is normal for Java applications. In most cases the majority of RAM used by Java is used for heap space, controlled by the Xmx parameter. Java uses garbage collection to free up heap space by removing no-longer needed objects in memory. If you have a task that requires a lot of memory,
you won’t be able to do other non-trivial tasks at the same time. There are some performance issues in SNAP 8 related to handling “no-data” values. If the extents of the images being stacked are very different, the calculation will be generating a lot of “no-data” values.

Please provide more details: What OS are you using? Are you using gpt CreateStack or the GUI? What SNAP version and have you installed the latest updates? What are you using for “Output Extents”? What is the extent and spatail resolution of the desired final stack?