A large canvas needs large amount of memory.
32x35x4 byte is about 4.4Kib, so one million is 4272Mib.
Just as your MemProfile says.

Either use some image format that can be written in chunks (AFAIK PNG can 
do this, but that's quite low-level),
or mmap the region of the pixels, or leave it to tho OS (swapping).

kryptic...@gmail.com a következőt írta (2022. január 23., vasárnap, 0:02:21 
UTC+1):

> Hi, what would be the correct way to composite millions of images on a 
> larger canvas?
> I am trying to composite a lot of 32x35 pngs to a larger canvas but the 
> method I am using, draw.Draw() seems to be too hungry for resources choking 
> the GC again and again.
>
> CPUProfile and MEMProfile added below. Thanks!
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/16af218f-3bf9-43aa-84fd-ed888a1d6ba8n%40googlegroups.com.

Reply via email to