Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

reducing memory footprint in task manager  RSS feed

 
jim mcnamara
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi-

i just added another feature to my java program at
http://www.3rdshiftcoder.com

i thought about putting it out there for download
to get a little feedback but there is one issue
that i think i should address first.

in the windows task manager it takes 72,000k worth
of resources.

i noticed squirrel sql only takes about 40,234k.

if i go through all my .java source files and eliminate
as many java.util.* and actually use something like
java.util.ArrayList (more specific) instead will this
help lower the amount of resources my program consumes?

the project has lots of external jars in it. i tried
to only add jars i really needed.

also i might add that i kind of wanted to find a java
centric download site because it is hard to compete
on downloads when other finance (budget) software requires
no jre and is only a 1.5mb download.

do you know any java download sites for general use
programs?

thanks for helping,
jim
 
jim mcnamara
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi-

there is one other item of possible interest.
squirrel sql and my checkbook program have
a different process name.

one uses java.exe and one uses javaw.exe.

not sure if that helps explain any difference.

thanks again,
jim
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if i go through all my .java source files and eliminate
as many java.util.* and actually use something like
java.util.ArrayList (more specific) instead will this
help lower the amount of resources my program consumes?


Not really. The import statement is for the compiler, it won't make the resultant program shorter, or consume less memory.

the project has lots of external jars in it. i tried
to only add jars i really needed.


Well, you should only have the jar files that you need in the classpath, but prior to Java 6, this should not have any effect on your program memory usage.

Starting from Java 6, a jar file in the classpath can run a piece of init code, but it is highly unlikely that you have such a jar file.

one uses java.exe and one uses javaw.exe.

not sure if that helps explain any difference.


I believe that the only difference is that javaw doesn't have a console.

Henry
 
jim mcnamara
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Henry.

i did many searches and finally came up with the same.
this just confirms it.

http://forum.java.sun.com/thread.jspa?threadID=753621&messageID=4306087

the link above says the same thing that Henry just confirmed
on import statements. i found this after Henry's post.

i guess for now i will give up on the memory issue.
maybe some day i will run into a java expert that can look
over my program and see if there is an easy way to reduce
some of the size of the java.exe or javaw.exe process when
the program loads. i will just be honest and advertise it
as a bit heavy on memory consumption.

thanks for helping,
jim
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!