Perhaps your one Java line is keeping the original image, the scaled image, and the image icon in memory.
Breaking up the code by doing it this way ensures that the original image and scaled image are dropped for garbage collection.
import java.awt.Image;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JToggleButton;
String text = "" + i;
File imageFile = new File(listOfFiles[i].getAbsolutePath());
BufferedImage image = ImageIO.read(imageFile);
Image scaledImage = image.getScaledInstance(139, 163,
BufferedImage.SCALE_SMOOTH);
ImageIcon imageIcon = new ImageIcon(scaledImage);
toglBtn = new JToggleButton(text, imageIcon);