Open omerkirk opened 8 years ago
I think that line with 5.2GB is mostly just internal allocations from dest
resizing itself. Doing a similar test with 5 columns I had zero bytes allocated on that line. Up the column count to 1000 and I'm at 1.7GB. Pre-allocate by passing in 1000 as the size when make
ing dest an I'm down to 13MB.
(Had a bit here about a possible optimization, but it wouldn't work)
Anyways, I'm not sure if that profile gives us the answer. My test code might not have been super accurate though.
Hi Jason,
As you can see from my previous issues, we are using your library extensively in a new project. We were seeing a steady memory increase in htop. The memory increases until the app crashes a day later. When we profiled it with pprof we saw an unusual amount of memory used by only the MapScan function in sqlx. We defer close both the statements and the rows returned by the library so I really don't understand where this memory is or why isn't it released back to the OS. Hopefully the following output would mean more to you than me.