1

I am writing a javascript application using the File API in Google Chrome. I am loading the files with the readDataAsURL method. I only need one file loaded at a time. So, each time I load a file, it gets added to memory and after a short while, the one tab will be maxing out my memory. Is there any way to unload the files when I am done with them before I load the next?

tshepang
  • 12,111
  • 21
  • 91
  • 136

2 Answers2

1

There's a bug in Chrome (http://crbug.com/36142) where the memory is not releasing after switching the img.src many times.

Try using createObjectURL(). See my response here: HTML5 File API crashes Chrome when using readAsDataURL to load a selected image

Community
  • 1
  • 1
ebidel
  • 23,921
  • 3
  • 63
  • 76
0

It will only stay in memory if you hold a reference to it. Otherwise garbage collection will free the memory for you automatically.

Jim Blackler
  • 22,946
  • 12
  • 85
  • 101