473,659 Members | 2,996 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Jar file Loading takes JVM memory ?

30 New Member
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 3448
JosAH
11,448 Recognized Expert MVP
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
ksrashmi
30 New Member
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.prin tln("Max Mem in reports= "+RT.maxMemory( )/DIV);
System.out.prin tln("Allocated Mem Rerports : " + RT.totalMemory( )/DIV);
System.out.prin tln("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
2051
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 think, specifically: - are these volumes, for this kind of configuration, at or beyond the levels at which PHP should be able to cope? I hope not ! - what might be done to alleviate these problems? One of our suspicions is that Windows...
3
8490
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: this.xmlDoc= new ActiveXObject("Microsoft.DomDocument"); this.xmlDoc.load(url);
2
3453
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 extreme conditions, it'll have to be queried thousands of times (maybe 20,000 times at most). Small fragments of this file are used to construct another file. What is most economical, in terms of system resources? Opening and closing the file +...
60
49061
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 be indexed/sorted. I don't want to load the entire file into physical memory, memory-mapped files are ok (and preferred). Speed/performance is a requirement -- the target is to locate the string in 10 seconds or less for a 100 MB file. The...
0
1408
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 load the swf file from memory instead of disk or an url. I can get the file from a url and load it to a memory stream, that is ready, but the problem is how to pass it to the ocx wrapper as the ocx takes only a path string to load the file when on...
5
1504
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 because we have our clients in germany and the server is located in the USA. But this is not the reason, because the ping is ok.
16
15548
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 faster, so I'd like to try creating multiple threads, and having them load different chunks of the file at the same time and process it asynchronously. Is it possible to do something like that, and if so, what would be needed to do so?
2
1824
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 takes a long time before the message "loading..." is replaced by file name. In my debugger, the switch between "loading..." and file name happens AFTER the last line of code below: void LoadReportFilesWorker_RunWorkerCompleted(object sender,
5
2935
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 loading the gzip data! Im using the default buffer of the stream that i open on the 20GB gzipped file and pass it into the GZipStream ctor. then System.IO.Compression.GZipStream takes an hour! when just loading 50GB file of data takes a few minutes!
0
8428
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8335
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8528
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7356
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6179
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1976
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1737
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.