Programming :: Using Java Runtime - Program Which Simply Calculates The Load Average Of A Process
Feb 10, 2011
I'm new to the linux world and its been quit sometime since i've done any programming. However, I'm writing a program which simply calculates the load average of a process. In doing this I need to use the uptime command for linux in a java program. I've done a little bit of searching on the net and it mentions this is possiable by using java runtime command. Unfortunatly though I have yet to find a working example of this. I've tried just simply reading the /proc/uptime file but I have no clue how to format the 2 numbers in seconds to make it the same as if you just typed in uptime in the linux command prompt.
I have a java process running in background. I have no java dependent program opened and even if I had, this program should be killed if I kill the Java process. top shows that Java causes almost 90% cpu usage.
The only way I can imagine is to restart, but this might happen again.
I am trying to install the Matlab 7.5 compiled runtime for 64-bit Linux (MCRInstaller.75.glnxa64.bin) and keep getting a "No Java Runtime Environment(JRE) was found on this system." error message.
I understand the JRE is bundled with MCRInstaller and will self-compile/install. However, I don't have admin access, could this be the source of the problem? If so, how could I fix it (not sure how to direct it to install locally without going into the source code)?
I got around this error before, but stupid me didn't write down what I did and I forgot.
I need to implement SAML 1.1 SSO process in Php(Preferred), Java, or C# I am having a very difficult time finding information related to this task. If I could use SAML 2.0 I would be home free with "Simple Saml Php" but I am not that lucky. Would the process be as simple as building the SAML in XML then submitting it with a SoapClient? According to the Docs I've read that would appear to work.
I'm having touble with a java web application. It's online learning through SEEK's skillport website and it uses JRE runtime environment to display the content. I have java installed for Ubuntu as per java.com's website instructions, and I can launch my web application, however it only displays the left half of the screen. The other half is just not there. I'm running Ubuntu 10.10, all updates applied. I've also tried installing OpenJDK Runtime Environment (IcedTea6 1.9.2) but the same sypmtoms occur. Skillport's support centre only supports Suse Linux so they couldn't help me. I'm wondering if Java is the problem or maybe a browser issue? I've tried in Firefox as well as Google Chrome for linux - same result. Currently I'm having to boot into Windows so I can do my study. Everything else works fine in Ubuntu.
I tried a lot but I can' t enable java in firefox. I' ve installed java jre 1.6.20, I created symbolic shorcut to .mozilla/plugins directory but it doesn' t work. By the way /plugins directory wasn' esixt and i created it in .mozilla dir. I use opensuse 11.2 and firefox 3.6.3.
AMD 64-bit quad core Scientific Linux 6.0 Firefox 3.6 Firefox is complaining that I need a java plugin. Apparently, it has to be installed manually. I managed to download jre-6u25-linux-x64.bin and saved it on my desktop. Then a ran jre-6u25-linux-x64.bin and it created a directory on my desktop called jre-6.0_25. Within the directory there the following subdirectories: bin, javaws, lib, man, and plugin.
I read the man pages of batch and it says that commands or scripts scheduled using the batch command will only execute when the load average goes below 0.8. As a newbie I hardy understand what it means. Does it mean that the system resources are busy?Ans since I want to see the o/p of the commands I have set using batch, is there any way i can bring the sys load average below 0.8?
I am trying to write a java program and eventually a web app to do the following.1. get the server name, username, password from the user and ssh to the linux box.2. goto a folder, open a script file (the file has different function calls, I need to comment all other function calls and just un-comment the one I want to use)
In gui validation if user enters string in integer requiring field, a dialog box pops out. So on clicking the button i want to stop the program execution and return to the previous jframe(either the same one or newly created object of it).
How can i handle this in java. I tried calling main(); but it doesn't work. Also System.exit(0); doensn't work.
Grub installed from 9 or 10 ubuntu simply won't load Windows.Ubuntu and GRUB on IDE hdd, Windows on SATA HDD.Installed all default options, just clicked thru install and when attempting to boot Windows XP screen is blank with a blinking cursor in the top corner.Same thing happened earlier when I ran Fedora 11 then 12.Different version of same result.Can't Canonic work with Grub developers to at least make a workable configuration r it's default setup?Searched the web, in a 1000 places same solution is offered: adding a few lines to menu.lst.1) the lines are already there2) this is for the old version of grub.Does grub actually work for anyone out there? Or is it only supposed to work in weird configurations?
The output of dpkg --get-selections | grep java on Karmic Koala is ca-certificates-javainstall java-commoninstall libaccess-bridge-javainstall libaccess-bridge-java-jniinstall sun-java6-bininstall sun-java6-jreinstall tzdata-javainstall
Yet when I go to a site like keepvid.com and enter a valid URL I get: Error: Please click here to download Java. If you already have Java, please restart your browser and try again. It appears you do not have Java installed or it is disabled on your system. You can get Java here. If you are still having difficulty with Java, check here for installing Java, or here for detailed instructions on enabling Java in your browser.
I downloaded Java into my home folder instead of downloading it in my usr folder because it wouldn't let me(even when I was root user). It is present in my home folder with its own directory, but I am unsure how to use it. I downloaded Java to try to play Minecraft, but when I open then .jar file with the directory nothing happens. The actual directory contains the following
folders:bin,javaws,lib,man,plugin,copyright,licens e,a read me file, thirdpartylicensereadme, and a welcome.html file. I don't like running Minecraft with OpenJDK because it lags tremendously and it won't close, and I heard the "real Java" runs it much better.Did I download it incorrectly, if so can you tell me how?
I was struggling to find the information so I thought it would be easier to ask here. What does the load average as reported by top mean ? To me those are 3 mysterious values, which most likely refer to some average CPU usage and this is all I know about it (not sure if it's true).What is the maximum value for this parameter (I guess the minimum is 0.00) and what does it mean ?
How to get the load average for each CPU core in multi core(eg:duel core machine) processor environment. I tried using,
Code: 1. cat /proc/loadavg 2. uptime 3. top But all of those commands gives the load average for whole system but not particular CPU core. Are there a way to take the load average for CPU core(Or any mechanism that can be done programmatic manner).
How to reduce the load average? I have two linux machines.. now my problem is that both the machines having same configuration and same processes are running in those two machines... But in one machine the load average is more than 3 and in other it is 0.5(when i am using top command).For this load average one machine(where load average is more) is slow when i am running application on it..
I wrote a script to extract and get the the name of *.gz in a foler . Since running that script every 10 minutes, load average on my server increases more than 10.I checked with 'top' and it showed many D process.
The load average is almost 1.06, but cpu is not 100% utilized... I am just wondering why load average is 1.06 in that case still ? (well i monitored cpu for long time, it never exceeded above 40%)can anyone explain the reason behind it ? Also is the system over utilized in this case ?
I have two servers. One in production (lets call it the OLD ONE) and the other (lets call it the NEW ONE) in tests to replace the OLD ONE.This is the basic hardware of each one: (I can post more detailed info if you need, but beside the erros on dmesg, look at the the L2 cache of the NEW ONE )
Old one: 2 quad core processors that linux recognize as 8 x Intel(R) Xeon(R) CPU E5440 @ 2.83GHz - 32Kb L1 - 6Mb L2 48Gb RAM
New one: 8 quad core processor that linux recognize as 32 x AMD Opteron(tm) Processor 6136 @ 2.400Mhz (- 64Kb L1 - 512Kb L2 128Gb RAM
The scenario:We run a dataflex system on the old one, with average of 3000 users, with tops at 3300 users and sometimes less then 2000. In the old one, we have a load average from 2 to 6 with the 3000 users, depending on the type of application (sometimes we run reports to txt files that take more then 6 hours to complete and the load average can raise to 12). 85% of this conections are from remote links. Dataflex is a language that derives from C that have their own sgbd (if we can call it that way), and have a limit of 2gb per table. This size we almost have on 5 tables and we use a dataflex feature to compress the data.
The problem:We are migrating (or trying to) the tables to oracle, so we bought new machines for the DB and the new one to replace the old one, becouse we think that could not handle the job with 2 oracles (load balance).In some tests we could see (or suposed) that the oracle database was not so fast with more then 1000 users (opening same table and doing the same task) and we decided to test the new one with the system that is in production right now, with dataflex tables, to ensure that the problem could be oracle.We change the HDs and IP. Started the system on the new one, and started to monitorate as the real users start their jobs. At 800 users the Load Average raised to 26 and with 1300 users we had more then 115 on Load Average. More users login in and the TOP become slow, pointing 400 of LA. From here we started to get some "Lock time out" erros and we had to change to the old one again, to prevent corruption on the tables. I'm analizing all report tools I know about performance and hardware and I cant see nothing. I saw some errors on dmesg, but I can say that is related to that problem.
this is my first post and I would like to get some help from you , so what should be the answer for this question ?:::::::::::::the question::::::::::::::::THE UNIVERSITY APARTMENTSThe University Apartments provides apartment rental to university students at affordable rates, with optional facilities:Apartment Type A, 2 bedrooms and equiped with kitchen and laundry facilities. The monthly rental for the rooms in this apartment type is RM300.Apartment Type B, 3 bedrooms includes one master bedroom with attached bathroom but does not have kitchen and laundry facilities. The monthly rental for the rooms in this apartment type is RM200 and students staying in the master bedroom will be paying an additional 40%.
Each apartment may house a maximum of 3 students. Students are required to check out from the apartment unit when the current semester ends.Create an application to manage the university apartments rental:1. Register new student and assign apartment moduleRegister and assigns an apartment to the student for 140 days from the date of registration. The module should retrieve the date automatically from the system clock and calculates the expiry date for the apartment rental. Before an apartment is assigned, the system should allow the selection of the type of apartment (i.e. Type A or B), then check for the number of occupants in the apartment. If the apartment already housed 3 students, it should recommend another apartment unit that is still available. Upon registration, student should pay a RM100 for the utility charges, rental deposit for one month and the rental for the current month.
2. Update apartment status moduleWhen a student moves out from an apartment, the apartment status is updated.3. Reporting moduleGenerates a report of apartments with full occupancy and another report for apartments where rooms are still available. 4. Search module Enable the administrator to search for a student's apartment unit using the student id as the search key. The search result should produce the student�s information and the details of the apartment that the student is staying in.The application should be developed using object-oriented concepts using Student class and Apartment class, implementing the appropriate data fields and methods for the classes. Data may be stored in collections i.e
In Iceweasel (Debian's name for Firefox) within the Preferences you can select "Load images automatically". I have this unchecked, because I use dial-up and prefer not to have to waste time with images. However, for some sites it's sometimes useful to load the images. So, I'm wondering if there is a way to simply load the images for a site that is easier than what I currently do (which is: going to Edit-Preferences-Content, rechecking "Load images automatically" then pressing Reload). In short, is there a way to have a button somewhere that I can press that will simply load the images for the current site while I can still have the "Load images automatically" preference box unchecked?