It might indeed be a leak. Unfortunately, this is a tough one to figure out. It
could be a vanilla memory leak, though I do keep an eye on it and run tests to try and spot any that slip by.
It could also be from a mod - unfortunately, it's *very* easy to code something in a mod, without a second thought, that would leak an entire campaign's worth of data every time you save or load.
That it happens during saving isn't necessarily an indicator of a problem with saving - saving just takes extra memory, and if an ongoing leak has increased the memory use to a point where there is enough to keep working, but not enough to save, then you'd see this issue.
... and only after a certain amount of time passes.
Is just that enough, or is save/loading prior to this involved as well? That'd be an interesting data point.
Again, though, this is tough to track down. Just as far as probability, I'd say it's more likely that there's a leak in a mod somewhere, but I certainly can't rule out a vanilla leak, either. I strongly suspect there is a leak
somewhere, though, because 4GB seems excessive and always has to me.
I wrote up the instructions to use jvisualvm to find these kinds of things a while back:
http://fractalsoftworks.com/forum/index.php?topic=7690.msg128363#msg128363But you'd have to be pretty comfy with dev tools and/or java to do that, I think. That's more aimed at modders - I think it might be worthwhile for people to check for leaks in this way, since, as I mentioned earlier, it can be very easy to get a save/load leak from code that otherwise works perfectly.