473,394 Members | 1,567 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,394 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 3418
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.