java - LWJGL with Slick-Util use a lot of RAM to load texture -


if use slick-util load textures lwjgl uses lot of ram. here example console-output:

message.info ((runtime.getruntime().totalmemory() - runtime.getruntime().freememory()) / 1000000 + "mb"); texturemanager.loadtexture("gui.wallpaper", "resources/wallpaper.jpg"); message.info ((runtime.getruntime().totalmemory() - runtime.getruntime().freememory()) / 1000000 + "mb"); 

the "texturemanager.loadtexture(...)" method following:

string texturefileformat; if (thepath.contains("png")) {     texturefileformat = "png"; } else if (thepath.contains("jpg")) {     texturefileformat = "jpg"; } else if (thepath.contains("jpeg")) {     texturefileformat = "jpg"; } else {     texturefileformat = "png"; }  thetexture = textureloader.gettexture(texturefileformat, new fileinputstream(thepath), true);  // === store onto hashtable === // textures.put(thename, thetexture); 

this uses (like viewable in console output) quit 80 mb. why? "wallpaper.jpg" 290kb lage!

what wrong?

this console output:

2013-09-24 21:32:40 [info] [client] 4mb tue sep 24 21:32:40 cest 2013 info:use java png loader = true 2013-09-24 21:32:41 [info] [client] 89mb 

i hope, of know solution.


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -