runtime: out of memory: cannot allocate 327434997084454912-byte block (4096000 in use) fatal error: out of memory #39423
Without knowing which version of Go you're using your stack traces aren't the most helpful, and how you're building the binary is important here, which you also don't specify. Without that data, and guessing, I don't think you're building the go code correctly as a shared library.
I'm not terribly familiar with building DLLs in Windows with Go, but the answers over at StackOverflow look correct to me:
I'd bet if you start from that as an example, you'll have it going in no time.
Closing this issue as it doesn't really seem to be a Go issue to me.