Serious Memory Issues while loading Images
Posted: Sun Apr 20, 2014 5:36 pm
Hello Everybody! Im partially new to Love2d and i almost finished my first game..
However, My game uses alot of Memory! and it's really slow to open.. like when i click on the .love file it causes my computer to freeze and takes more than 10 seconds to start! Moreover, what's even worse, it draw alot of Memory! Over 385k! But i'm not surprised though, i'm loading more than 300 images in my game through love.load()
I tried to monitor where all the memory issues is coming from and discovered that the line:
is causing all the problems.. In that lua file im trying to load like almost 250 images and im not done yet.. i'm loading them without calling a function, just by defining table.. like this as an example:
Almost 300 line like that... Hehe...
I Considered using Kikito Library(This guy is epic though) loader.. i thought it might help.. but i prefered making sure that it will help before wasting time using it..
What's even worse i'm only half done of adding images and there's still sounds...
I don't want to add love files because i want it to still exclusive until i release it soon enough..
What's the best way to fix this major problem? And is there any way i can lower the memory consumption?
Thanks Guys! You're Epic!
UPDATE: https://www.dropbox.com/s/inlqlae5csogrsz/DEMO.love Love File
However, My game uses alot of Memory! and it's really slow to open.. like when i click on the .love file it causes my computer to freeze and takes more than 10 seconds to start! Moreover, what's even worse, it draw alot of Memory! Over 385k! But i'm not surprised though, i'm loading more than 300 images in my game through love.load()
I tried to monitor where all the memory issues is coming from and discovered that the line:
Code: Select all
require "Laboratory"
Code: Select all
Step1[1] = love.graphics.newImage("Resources/Dilution/Step1/1.png")
Step1[2] = love.graphics.newImage("Resources/Dilution/Step1/2.png")
Step1[3] = love.graphics.newImage("Resources/Dilution/Step1/3.png")
Step1[4] = love.graphics.newImage("Resources/Dilution/Step1/4.png")
Step1[5] = love.graphics.newImage("Resources/Dilution/Step1/5.png")
Step1[6] = love.graphics.newImage("Resources/Dilution/Step1/6.png")
Step1[7] = love.graphics.newImage("Resources/Dilution/Step1/7.png")
Step1[8] = love.graphics.newImage("Resources/Dilution/Step1/8.png")
Step1[9] = love.graphics.newImage("Resources/Dilution/Step1/9.png")
Step1[10] = love.graphics.newImage("Resources/Dilution/Step1/10.png")
Step1[11] = love.graphics.newImage("Resources/Dilution/Step1/11.png")
Step1[12] = love.graphics.newImage("Resources/Dilution/Step1/12.png")
I Considered using Kikito Library(This guy is epic though) loader.. i thought it might help.. but i prefered making sure that it will help before wasting time using it..
What's even worse i'm only half done of adding images and there's still sounds...
I don't want to add love files because i want it to still exclusive until i release it soon enough..
What's the best way to fix this major problem? And is there any way i can lower the memory consumption?
Thanks Guys! You're Epic!
UPDATE: https://www.dropbox.com/s/inlqlae5csogrsz/DEMO.love Love File