473,326 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Jar file Loading takes JVM memory ?

Hi ,

does jar file loaidng will consume the jvm memory ?

I have to run the cronjobs for some of the java files . so i have writen the .sh file ( linux server)

This is the Script file
Expand|Select|Wrap|Line Numbers
  1. temp_path=/bin:/usr/sbin:/usr/bin
  2. export temp_path
  3.  
  4. #Setting java commands & classpaths
  5. javac=/usr/local/jdk1.5.0_03/bin/javac
  6. java=/usr/local/jdk1.5.0_03/bin/java
  7. lib=/home/rashmi/tomcat1/lib
  8. JAVA_OPTS="-Djava.awt.headless=true" ; export JAVA_OPTS
  9. echo "$JAVA_OPTS"
  10. cjar=.
  11. for i in $lib/*.jar
  12. do
  13.     cjar=$cjar:$i
  14. done
  15.  
  16. cjar=$cjar:/home/rashmi/ValYouAdd/jakarta-tomcat-5.0.28/common/lib/servlet-api.jar
  17. cjar=$cjar:$lib/../classes
  18. #echo "CLASSPATH:$cjar"
  19.  
  20. #Execute  Blocking Check
  21. $java -classpath $cjar com.cerulean.cronjob.systemtask.Test
  22.  
it is working fine in our server . but in client server cronjobs are getting killed .
Hosting people are telling it is using more memory .
I have witen one Java file where there is one One line of system .out.println .
Even that file is getting killed .
Will the Jar file loading consume the memory

beaucse lib=/home/rashmi/tomcat1/lib will load all the jar files

i tried to give specific jar files insted of loading all the jars but it is not compliing the java file
example lib=/home/rashmi/tomcat1/lib/mail.jar

Please help me on this thanks
Dec 10 '08 #1
2 3410
JosAH
11,448 Expert 8TB
Java is extremely cheap when it comes to loading classes (and it doesn't matter whether those classes come from .jar files or not). For user classes only the to be used classes are actually loaded. Entire jar files are not loaded when one or two classes are needed.

Does your client machine have considerably less memory than your server machine? What actually does your Java program want to accomplish?

kind regards,

Jos
Dec 10 '08 #2
We have several back end script like creating PDF reports and sending those . and few other Reports .

And We are using the Hibernate for database connectivity

Client System JVM memory is 128 MB . even our local server is of 128 MB .

But Hosting People have told to restrict to use only 50 MB for the back end script .

i am trying check how much memory it is taking

System.out.println("Max Mem in reports= "+RT.maxMemory()/DIV);
System.out.println("Allocated Mem Rerports : " + RT.totalMemory()/DIV);
System.out.println("Free Mem: " + RT.freeMemory()/DIV);

i used Runtime methods to get the memory details .
this shows 90MB as free memory .
Is this correct way to check the memory usage ?
Dec 11 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Rob Tweed | last post by:
I have a customer who is having problems when their Windows 2000/IIS/PHP-based system begins to experience a level of loading that isn't, in my view, unreasonably high. I'm wondering what others...
3
by: Roy Wang | last post by:
hi, My problem is how to determining when the XML file has loaded using javascript. I loaded an xml file using javascript in a web page. The code below is loading the xml file for IE:...
2
by: Gustaf Liljegren | last post by:
I'm writing a program that will query an XML file with the XmlTextReader class (the question is not specifically about XML, however). This file is very large (maybe 20 MB at most), and during...
60
by: Julie | last post by:
What is the *fastest* way in .NET to search large on-disk text files (100+ MB) for a given string. The files are unindexed and unsorted, and for the purposes of my immediate requirements, can't...
0
by: Carlos Lozano | last post by:
Hi, I am working on a Flash player customization. The player is ready and works when loading the swf file from disk or url. That was pretty simple using a Flash.ocx wrapper. I would like to...
5
by: Danny | last post by:
Hi, we have just uploaded our first APS.NET webpage some days ago. Now we had to notice that it takes soo long until the page is shown. About 15 seconds. First we thought, maybe it's...
16
by: WATYF | last post by:
Hi there... I have a huge text file that needs to be processed. At the moment, I'm loading it into memory in small chunks (x amount of lines) and processing it that way. I'd like the process to be...
2
by: Curious | last post by:
There's a problem with what is displayed on a tab in my UI. At first, it's a message, "loading...". Then it should be replaced with the actual file name on the tab. Now the issue is that it...
5
by: DR | last post by:
Why is its substantialy slower to load 50GB of gzipped file (20GB gzipped file) then loading 50GB unzipped data? im using System.IO.Compression.GZipStream and its not maxing out the cpu while...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.