JDBC & mSQL
After figthing a while with the odbc driver for Linux and wasting lot of
time configuring the windows machine, i decided to migrate the database to
mSQL, but now that i got a functional code (access and reads the data),
when i insert it into the applet, it doesn't work...
Is there anything extra that i must do in the Applet code to make it run?
Here is the code on both programs :
String dB="some_database";
String url="some_domain";
Class.forName("com.imaginary.sql.msql.MsqlDriver");
Connection con=DriverManager.getConnection("jdbc:msql://"+url+"/"+dB);
Statement stm=con.createStatement();
String sqlselect="Select * from foo where bar like '_string'";
resultSet=stm.executeQuery(sqlselect);
The one that i use to send messages through System.out.println is the one
that works...
Any ideas or comment are welcome...
Regards,
___
Urivan Saaib
Email: [EMAIL PROTECTED]
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: idltojava for linux
Eric Mitchell wrote: | How much work is involved in porting idltojava to run on | Linux? Is it just a matter of tweaking some lex/yacc code | (as someone suggested earlier)? Has anyone tried it? How | would someone volunteer to help this process? I believe that the idltojava-compiler for java1.3 (java3 ?) is written in java (saw this work in Linux). Try searching tools.jar in the jdk1.3-distribution to find something looking like an idltojava-compiler (unfortunatly I haven't downloaded 1.3 because it either comes in the form of a windows executable or a solaris shell-script (which I'm not in the mood for debugging) so I'm unable to help you with this). -- Jo Uthus| e-mail: [EMAIL PROTECTED] (private) Software Engineer | e-mail: [EMAIL PROTECTED] (work) -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: trouble setting breakpoints in my jni code with ddd/gdb
On Mon, 03 Jan 2000, you wrote: > richard johnson wrote: > > > > Program received signal ?, Unknown signal. > > 0x4012eb6e in __sigsuspend (set=0xb2a8) at >../sysdeps/unix/sysv/linux/sigsuspend.c:48 > > 48 ../sysdeps/unix/sysv/linux/sigsuspend.c: No such file or directory. > > The "no such file or directory" just means that gdb can't find the > source file in order to display source lines. The real problem here is > the unknown signal, which I don't know how to address. Does it only die > this early when running under the debugger? Yes. It appears to only die this early when the debugger is in use. What do you make of the line in the stack trace in sysThreadCreate ...at ../../../../../src/linux/hpi/native_threads/src/threads_md.c:403 I noticed that this is a native threads method, yet I was running green threads when this happened. Does green threads have native threads for the threads beside main (SIGQUIT and ?)? > > Have you tried the Blackdown or Inprise JDK1.2.2 - those will give you > two additional sample points. > First, I am going to re-check my installation to see if I have the right version of the jdk 1.2 pre2 installed. If this checks, I plan to install the debug addendum for 1.2 and see if there is more information about what is happening by running/studying the debug vm. My next attempt will be with the 1.2.2 from Inprise as it will not require a new glib version ... as I recollect. Installing a new glib is somewhat messy from what I have read. Then I might upgrade my kernel to SuSE 6.3 which I believe has the appropriate glibc for Blackdown 1.2.2. If I come up with something I'll post the list so that maybe someone else won't go through this. Thanks again for your help. Rich > > > I want to thank you for your help with the debugging of the my > > unloaded native lib. The use of the LD_PRELOAD allowed me > > to set the breakpoint in my native library (after as you suggested, > > setting the breakpoint in main() and stopping there). I bought > > your book too! > > > > Unfortunately, I am not reaching this breakpoint instead dying > > during jvm initialization trying to create the SIGQUIT handler. I get the >following > > message in the gdb window of my ddd debugger session: > > > > Program received signal ?, Unknown signal. > > 0x4012eb6e in __sigsuspend (set=0xb2a8) at >../sysdeps/unix/sysv/linux/sigsuspend.c:48 > > 48 ../sysdeps/unix/sysv/linux/sigsuspend.c: No such file or directory. > > > > The call stack looks like this: > > > > in __sigsuspend ... at ../sysdeps/unix/sysv/linux/sigsuspend.c:48 > > in __pthread_create_2_1 ...at restart.h:32 > > in sysThreadCreate ...at >../../../../../src/linux/hpi/native_threads/src/threads_md.c:403 > > in threadCreate ... at ../../../../src/share/javavm/runtime/threads.c:167 > > in createSystemThread "SIGQUIT handler" ...at >../../../../src/share/javavm/runtime/threads.c:506 > > in InitializeSignals ...at ../../../../src/linux/javavm/runtime/signals_md.c:548 > > in InitializeJavaVM ...at ../../../../src/linux/javavm/runtime/javai.c:847 > > in JNI_CreateJavaVM ...at ../../../../../src/share/javavm/runtime/jni.c:3263 > > in InitializeJVM ...at ../../../../../src/share/bin/java.c:467 > > in main ...at ../../../../../src/share/bin/java.c:173 > > > > It looks like I am missing some file or have a bad path somewhere that causes the > > "SIGQUIT handler" to abort. Does anyone know what file or directory is being > > sought? What do I do next? Should I install the debug version? Is there >documentation > > available that describe the jvm initialization? > > > > I am using SuSE 6.2 (glibc2.1), blackdown jdk1.2 pre release v2` > > with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
error when creating a window using invocation api
Hi, I created a Java Virtual Machine in C++. This Virtual Machine starts a Java application. This works, but when I try to start a Java application which shows windows, I get the following error : /usr/jdk117_v3/lib/i686/native_threads/libawt.so: undefined symbol: xmDrawingAreaWidgetClass (libawt.so) java.lang.UnsatisfiedLinkError: no awt in shared library path at java.lang.Runtime.loadLibrary(Runtime.java) at java.lang.System.loadLibrary(System.java) at at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:394) at java.awt.Window.getToolkit(Window.java:230) at java.awt.Frame.addNotify(Frame.java:283) at java.awt.Window.show(Window.java:145) at java.awt.Component.show(Component.java:511) at java.awt.Component.setVisible(Component.java:473) at Start.run(Start.java:59) at Test.test(Test.java:161) Does anybody has an idea what could cause this error ??? Thanks ... E-Mail : [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
RE: How do you use JDK?
Hi!
All that you need to do your work is like this:
import java.util.Date;
public class Clock2 extends Thread {
public static void main( String [] args ) {
new Clock2( );
}
public Clock2( ) {
this.start( );
}
public void run( ) {
while( true ) {
try {
Date d = new Date();
System.out.println( d.toString( ) );
this.sleep( 1000 ); // Wait a second for next step...
} catch( Exception e ) {
System.err.println( "Error occurred: " + e.toString( )
);
}
}
}
}
This is a fully functional program.
Note that this program have a public static void main(String [] args) required as
"entry point" for java Apps.
I think that this solve your problem for start coding.
And, about classpath, if you are using Java 2 plataform, clear your classpath, because
you dont need this. If you are using JDK 1.x, put in your classpath the path for
classes.zip and . ( /jdk/lib/classes.zip:. ).
Edson Richter
--
From: [EMAIL PROTECTED]
Sent: terça-feira, 4 de janeiro de 2000 02:24
To: [EMAIL PROTECTED]
Subject:How do you use JDK?
This might sound ignorant, but everything I've read is about
java programming syntax and stuff like that. My question is
how do you run a java program? Just using java ./Clock2 doesn't
work. I either get "class not found" or "In class Clock2: void
main(String argv[]) is not defined" I've added every directory
in jdk118_v1 to my CLASSPATH and PATH and nothing works. If I try
jre ./Clock2 I get "In class main: public static void main(String
args[]) is not defined." I get these same errors for every demo
I try. There must be something very simple that I am missing.
Every demo ever written can't be broken. Whats the trick? I am
running Mandrake 6.1 and it doesn't include kaffe. Thanks for
any info you can give me. Especially if someone could point me
to some documentation more informative than:
"Running Java on Linux is about what you'd expect. You should be
able to run most "pure Java" applications on the Linux JDK or JRE.
It does take a little longer to get the latest JDK on a target
that Javasoft doesn't officially support."
That little nugget from the FAQ tells me nothing usefull. I have
no idea what to expect other than jre filename or java filename
and something happens. But it ain't happening for me.
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
RE: JDBC & mSQL
An applet can do connection only to host from are served the page where applet is
inside.
And, you must provide that classes for connection. See docs for tag about
putting classes accessible for browsers.
IMPORTANT: If you are developing for Java 2 plataform, you must use Java Plug-in -
not the Applet tag, because Browsers don't know nothing about Java 2 things.
Edson Richter
--
From: Urivan Saaib
Sent: terça-feira, 4 de janeiro de 2000 05:50
To: [EMAIL PROTECTED]
Subject:JDBC & mSQL
After figthing a while with the odbc driver for Linux and wasting lot of
time configuring the windows machine, i decided to migrate the database to
mSQL, but now that i got a functional code (access and reads the data),
when i insert it into the applet, it doesn't work...
Is there anything extra that i must do in the Applet code to make it run?
Here is the code on both programs :
String dB="some_database";
String url="some_domain";
Class.forName("com.imaginary.sql.msql.MsqlDriver");
Connection con=DriverManager.getConnection("jdbc:msql://"+url+"/"+dB);
Statement stm=con.createStatement();
String sqlselect="Select * from foo where bar like '_string'";
resultSet=stm.executeQuery(sqlselect);
The one that i use to send messages through System.out.println is the one
that works...
Any ideas or comment are welcome...
Regards,
___
Urivan Saaib
Email: [EMAIL PROTECTED]
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
java.lang.NoClassDefFoundError:
hai, I have installed JDK 1.2.2 on Redhat 6.1, i am able to compile and run java programs , but rmi is giving problems, when i type rmic it is giving the following error. Please tell me how to rectify the problem. java.lang.NoClassDefFoundError: sun/rmi/rmic/Main at java.lang.Throwable.(Throwable.java:40) at java.lang.Error.(Error.java:21) at java.lang.LinkageError.(LinkageError.java:21) at java.lang.NoClassDefFoundError.(NoClassDefFoundError.java:21) Thanking you in anticipation. bye balaji -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
JDK1.2 installation on Linux...
Hi! , I just downloaded the file jdk1.2pre-v2.tar.bz2 , but I don't know how to install it. Anyone could please let me know how / from where I can install JDK1.2 on Linux... Thanks & Regards Pramila
Re: trouble setting breakpoints in my jni code with ddd/gdb
Richard Johnson wrote: > Program received signal ?, Unknown signal. > 0x4012eb6e in __sigsuspend (set=0xb2a8) at >../sysdeps/unix/sysv/linux/sigsuspend.c:48 I guess your GNU debugger (gdb) doesn't support LinuxThreads which JDK uses as native threads. I can get the following message with gdb 4.18: Program received signal SIG38, Real-time event 38. 0x2ab6d58b in __sigsuspend (set=0x7fffee34) at ../sysdeps/unix/sysv/linux/sigsuspend.c:48 In this case, LinuxThreads uses SIG38, SIG39 and SIG40. You can find the following code in pthreads.c of LinuxThreads. int __pthread_sig_restart = __SIGRTMIN; int __pthread_sig_cancel = __SIGRTMIN + 1; int __pthread_sig_debug = __SIGRTMIN + 2; I suggest using the version of gdb supports LinuxThreads if you want to debug with native threads. In the case that the signal for LinuxThreads suspends the execution, you can use the `continue' command of gdb. And you can also instruct the gdb how to handle signals with the `handle' command. I wrote `handle SIG38 nostop' into the $HOME/.gdbinit file. If you'd like to use green threads usually, you may modify the bin/.java_wrapper file. Modify the following line as you like: DEFAULT_THREADS_FLAG=native Kazuyuki SHUDO Happy Hacking! Muraoka Lab., School of Sci. & Eng., Waseda Univ. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: JDK1.2 installation on Linux...
first bunzip2 then tar xvv tarfile -Original Message-·¢¼þÈË: Pramila <[EMAIL PROTECTED]>ÊÕ¼þÈË: java-linux <[EMAIL PROTECTED]>ÈÕÆÚ: 2000Äê1ÔÂ4ÈÕ 22:21Ö÷Ìâ: JDK1.2 installation on Linux... Hi! , I just downloaded the file jdk1.2pre-v2.tar.bz2 , but I don't know how to install it. Anyone could please let me know how / from where I can install JDK1.2 on Linux... Thanks & Regards Pramila
Re: JDK1.2 installation on Linux...
1. Where to obtain JDK 1.2 for Linux? http://www.blackdown.org/ 2. Go to "Download the JDK for Linux" link 3. Find appropriate ftp site 3. Go to the JDK1.2/i386/pre-v2/glibc2.1 directory 4. Middle click on jdk1.2pre-v2-debug.tar.bz2 file 5. Menu opens - download the file 6. Unzip the file with bzcat bzcat jdk1.2pre-v2-debug.tar.bz2 > jdk1.2pre-v2-debug.tar 7. Untar the file tar xvf jdk1.2pre-v2-debug.tar 8. Set up the path set path = (/homes/nikom/work/java/bin1/jdk1.2/bin $path) Hope it helps, Jacob Nikom > Pramila wrote: > > Hi! , > > I just downloaded the file jdk1.2pre-v2.tar.bz2 , but I don't know > how to install it. > > Anyone could please let me know how / from where I can install > JDK1.2 on Linux... > > Thanks & Regards > Pramila -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: trouble setting breakpoints in my jni code with ddd/gdb
SHUDO Kazuyuki wrote: > If you'd like to use green threads usually, you may > modify the bin/.java_wrapper file. Modify the following > line as you like: > > DEFAULT_THREADS_FLAG=native It should also work just to set (and export) the environment variable THREADS_FLAG=green. Nathan SHUDO Kazuyuki wrote: > > Richard Johnson wrote: > > > Program received signal ?, Unknown signal. > > 0x4012eb6e in __sigsuspend (set=0xb2a8) at >../sysdeps/unix/sysv/linux/sigsuspend.c:48 > > I guess your GNU debugger (gdb) doesn't support > LinuxThreads which JDK uses as native threads. I can get > the following message with gdb 4.18: > > Program received signal SIG38, Real-time event 38. > 0x2ab6d58b in __sigsuspend (set=0x7fffee34) > at ../sysdeps/unix/sysv/linux/sigsuspend.c:48 > > In this case, LinuxThreads uses SIG38, SIG39 and > SIG40. You can find the following code in pthreads.c of > LinuxThreads. > > int __pthread_sig_restart = __SIGRTMIN; > int __pthread_sig_cancel = __SIGRTMIN + 1; > int __pthread_sig_debug = __SIGRTMIN + 2; > > I suggest using the version of gdb supports LinuxThreads > if you want to debug with native threads. In the case > that the signal for LinuxThreads suspends the execution, > you can use the `continue' command of gdb. And you can > also instruct the gdb how to handle signals with the > `handle' command. I wrote `handle SIG38 nostop' into the > $HOME/.gdbinit file. > > If you'd like to use green threads usually, you may > modify the bin/.java_wrapper file. Modify the following > line as you like: > > DEFAULT_THREADS_FLAG=native > > Kazuyuki SHUDO Happy Hacking! > Muraoka Lab., School of Sci. & Eng., Waseda Univ. > > -- > To UNSUBSCRIBE, email to [EMAIL PROTECTED] > with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
compiling the JDK
it looks like i will have to compile the JDK to figure out my glibc2.1.2 troubles. i read the page http://www.place.org/~stevemw/java/FAQ/README.linux.src.txt is this the latest data on compiling? can i use this to compile the latest versions? thanks for the input! i don't see others getting much response on this topic. --michael moores tech leader, e-commerce Real Networks -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Font Problems
I am running JDK 1.2.2 on RedHat Linux 6.1. My font path (as provided by chkfontpath --list) includes among others: /usr/X11R6/lib/fonts/URW These are the fonts that I downloaded from the gimp site. These fonts include "-Adobe-Zapf Dingbats-..." When I run the SwingSet application, I get the message that it is unable to find "--dingbats-..." which is listed in the font properties. Under the previous JDK1.2, I had gotten rid of this error message, by actually copying my URW fonts under the "jre/lib/fonts" and amending the "fonts.dir" file to include them. Should this have been necessary? Should java be able to find the fonts in the X font path? Now, however, even this technique does not work. Is this because the name has changed in the font.properties file from "--zapf dingbats-" to "--dingbats"? My XF86Config has the following line with regard to fonts: FontPath "unix/:-11" and I am running the "xfs" file server supplied by RedHat. I realize that the messages are harmless; however, I would like to understand how to deal with fonts under the JDK for Linux. I did read the "README.LINUX" that was supplied with the JDK. I also searched the RedHat site for any information that I could find on fonts. I even dug out my old X11 book and re-read the section on fonts. But so far, nothing has worked. So I would greatly appreciate some guidance again. Thanks, Cynthia Jeness -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
QuoteGrabber-2.0-BETA14 released under the GPL
A new release of the QG is available at: http://www.aparima.com/quote/download.html 2000-01-04 QuoteGrabber 2.0-BETA14 release. The QuoteGrabber is now free software, released under the GPLv2. It means is that you can freely copy and distribute it, however if you modify it and wish to distribute the resulting software you must make the modified sources available to the community under the same license. Separate commercial license agreements which don't carry this source code clause are still possible. The full source code for the QuoteGrabber is available at: http://www.aparima.com/quote/classes/qg2src.zip Releasing the QG as open-source software is done with the objective of letting its users/developers improve and extend the software. More data providers should be supported, more bugs should be found and new features added faster. Further, the QG's future is now better guaranteed because it doesn't rest on the fate of a single company or developer. >From now on QG development will be organized on the [EMAIL PROTECTED] mailing list. Changes summary: No more installers: the QG is now released in the JAR format, a 400K file containing everything necessary to run the QG on a Java2 platform (aka Java-1.2.2). A developer's mailing list is open for subscriptions at [EMAIL PROTECTED] Send the word "subscribe" in the subject of your message. A CVS server will soon be setup for collaboration on the QG source code. Initially the mailing list will be the main development tool. You can perform a quick upgrade of your QG version only by downloading and replacing the qg2.jar file in your installation. It is available at: http://www.aparima.com/quote/classes/qg2.jar Additionally, if you have the Sun Java2 JRE installed you need only this file. Put it on your desktop and double-click to launch the QG. -- Louis-David Mitterrand - [EMAIL PROTECTED] - http://www.aparima.com -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Errors in Standard In
Hello I have a problem with a proxy Server which is written in java.When I get error-messages like "NoRoutetoHost-Exception", they are thrown out on my console (stdin).How can I route this error-messages into a file or to /dev/null? I think this is a option of the javaVM and not one of the program! bYe Chris -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: Errors in Standard In
Christian Biermann wrote: > > Hello > > I have a problem with a proxy Server which is written in java.When I get > error-messages like "NoRoutetoHost-Exception", they are thrown out on my > console (stdin).How can I route this error-messages into a file or to > /dev/null? > I think this is a option of the javaVM and not one of the program! A line somewhere in the program is outputting those messages. One solution is to change the program to send the messages to a file. Programs in Linux and Unix have two output channels, stdout and stderr - they typically send normal output to stdout and error output to stderr. Java has the same thing, in the System.out and System.err streams. You can redirect either output by doing something like this: java ...command... >file1 2>file2 Any stdout output is redirected into file1, while any stderr output is redirected into file2. Note that these are not JavaVM options, it's the Linux shell that is handling the redirection and it works the same way with all programs (not just Java). Nathan > > bYe > Chris > > -- > To UNSUBSCRIBE, email to [EMAIL PROTECTED] > with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: compiling the JDK
Michael, The easiest way to compile the Blackdown port is if you use the 'patchomatic.sh' script to apply their patches. It extracts the archives and sets up the directories for you (and is *way* faster and better than doing it by hand). Just be sure to edit the patchomatic.sh script to set up the variables at the beginning to match your environment before you run it. --Jeff "Michael E. Moores" wrote: > > it looks like i will have to compile the JDK > to figure out my glibc2.1.2 troubles. > > i read the page > http://www.place.org/~stevemw/java/FAQ/README.linux.src.txt > > is this the latest data on compiling? can i > use this to compile the latest versions? > > thanks for the input! i don't see others getting > much response on this topic. > > --michael moores > tech leader, e-commerce > Real Networks > > -- > To UNSUBSCRIBE, email to [EMAIL PROTECTED] > with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED] -- Jeff Galyan http://www.anamorphic.com http://www.sun.com jeffrey dot galyan at sun dot com talisman at anamorphic dot com Sun Certified Java(TM) Programmer == Linus Torvalds on Microsoft and software development: "... if it's a hobby for me and a job for you, why are you doing such a shoddy job of it?" The views expressed herein do not necessarily reflect those of my employer. Sun Microsystems, Inc., has no connection to my involvement with the Mozilla Organization. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
date problem
Hi all,
I have a problem with the Date (java.util.Date) on Blackdown JDK118 on
Redhat Linux. I checked the OS with date command line, which prints the
correct local time.
What I have figured out is that JVM misinterprets time zones. What I get
from the command line is " Wed Jan 5 11:17:07 EST 2000", which is correct.
That is 11+ hours different from GMT in daylight savings time. However EST
in this case means the Melbounre time zone. If I use the following code,
what I get is "Tue Jan 04 19:17:44 EST 2000", which is the American east
time, which is definitely NOT Melbourne time. According to what I read, the
Melbourne time (Australian Estern time) should be coded as AET in Java. What
I fail to understand is that why JVM can't read what is provided by the OS.
Date trialTime = new Date();
System.out.println("now: " + trialTime.toString() );
What I am after is how we can configure the JVM to read the time zone
correctly if possible.
cheers
G
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
heap space and performance
i wonder if someone can provide some insight
on the garbage collection and heap size.
i wrote a program (below) in a loop
and recorded the response times and heap size.
when i started it, i was able to run the loop
125 times per second, using 11% CPU. after several minutes,
i ran out of memory (default 16MB), and
my loop time was about 100 times every 6 seconds,
and the CPU was at 49%.
my questions are:
1. why does performance go down so much when the heap size goes up?
are we taking up lots of time sweeping through the heap?
2. why does the jvm max out the heap when
my objects are falling out of scope long before
the maximum heap is reached.
3. would it help to increase the max heap size (16MB), or
is this just covering up another problem?
public class test {
public static void main(String[] args) throws Exception {
int arg;
long mem;
arg = Integer.parseInt(args[0]);
for (int i = 0; i < arg; i ++) {
work(i);
}
}
private static void work(int i) {
try {
if (i%100 == 0) {
Runtime rt = Runtime.getRuntime();
System.out.println(i + ": " + rt.totalMemory() + " bytes\n");
}
URL yahoo = new URL("http://127.0.0.1/");
URLConnection yc = yahoo.openConnection();
BufferedReader in = new BufferedReader(
new InputStreamReader(
yc.getInputStream()));
String inputLine;
while ((inputLine = in.readLine()) != null)
{}//System.out.println(inputLine);
in.close();
}
catch(IOException e){
}
}
}
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: Font Problems
This turned out to be "operator error". I had forgotten that the accelerated server that I am using from Xi graphics does not used the standard XF86Config file but rather its own file, "Xaccel.ini". As soon as I updated the font path for the URW fonts in this file, then the fonts were handled as I expected. The good thing is that I was forced to review a lot of information about fonts. My only remaining comment is that the names of the java fonts in the "font.properties" file were changed from "zapf dingbats" to "dingbats" and from "symbol" to "standard symbols l". I changed the names back to avoid the font not found errors on start-up. Cynthia Jeness Cynthia Jeness wrote: > I am running JDK 1.2.2 on RedHat Linux 6.1. My font path (as provided > by chkfontpath --list) includes among others: > > /usr/X11R6/lib/fonts/URW > > These are the fonts that I downloaded from the gimp site. > > These fonts include "-Adobe-Zapf Dingbats-..." > > When I run the SwingSet application, I get the message that it is > unable to find "--dingbats-..." which is listed in the font properties. > > Under the previous JDK1.2, I had gotten rid of this error message, by > actually copying my URW fonts under the "jre/lib/fonts" and amending the > > "fonts.dir" file to include them. Should this have been necessary? > Should java be able to find the fonts in the X font path? Now, however, > > even this technique does not work. Is this because the name has changed > > in the font.properties file from "--zapf dingbats-" to "--dingbats"? > > My XF86Config has the following line with regard to fonts: > >FontPath "unix/:-11" > > and I am running the "xfs" file server supplied by RedHat. > > I realize that the messages are harmless; however, I would like to > understand how to deal with fonts under the JDK for Linux. > > I did read the "README.LINUX" that was supplied with the JDK. I also > searched the RedHat site for any information that I could find on > fonts. I even dug out my old X11 book and re-read the section on > fonts. But so far, nothing has worked. So I would greatly appreciate > some guidance again. > > Thanks, > Cynthia Jeness > > -- > To UNSUBSCRIBE, email to [EMAIL PROTECTED] > with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
