Win a copy of Rust Web Development this week in the Other Languages forum!

Ron Price

Greenhorn
+ Follow
since Apr 08, 2005
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ron Price

Hello,

I've been interested in starting to prepare for the SCEA EE5 exams for a while now, but I keep thinking I should wait until the new training material is completed.

I'm specifically interested in the second edition of Sun Certified Enterprise Architect for Java EE Study Guide by Mcgraw-Hill. I guess the first edition was really rushed and had many errors. Any ideas on if there will be a second edition? If so, when I might it be out?

Also, I'm hoping Sun will come out with an online training course; more than just a training course on creating an EE5 application, which they already have. Anyone know if if Sun is going to create en SCEA EE5 web prep course for part one of the exam?

Lastly, I've already picked up pretty much all the books that other threads have mentioned for this certification.
Thanks for all of your comments.


I just want to ask two more questions regarding most java applications:

How many people think that the time taken by the JVM for class loading, JIT processing and the garbage collector running would be significant?

How many people think that running the garbage collector is significant, but class loading and JIT are not significant?

I really think that for most applications java is more than fast enough.
14 years ago
I wanted add one more bit here about java real-time. I chatted with
the real-time developers at javaOne and real-time is very cool and it has its place. The key feature, from my perspective, is that methodA() will alway take the same amount of time with java real-time if it is written using the magic real-time threads. The point of my comment is that the name of real-time may be a bit misleading. What it really insures is that methodA() will run in the same fixed amount of time every time (no GC interruption or anything else).
14 years ago

Originally posted by Peter Chase:


... and yet you don't want to pay for a proper real-time system? Ever heard of the term "false economy"?!



I'm not sure how expensive real time is. I did look, it appeared I would have to contact Sun for the price; I'm not that interested yet.

Peter, it isn't that I don't want to pay for a proper real time system. For now I'm investigating all my options and confirming concerns about overhead due to class loading, JIT and GC. If my group comes to the conclusion that real-time is the best choice then we will obtain it. In real-time you have three types of threads: normal, slightly memory limited and very memory limited. In order to get real-time behavior you have to create a real-time thread that cannot have any dynamic memory allocation and you get complications similar to C/C++. This is a concern for me. At that point maybe I should just use C/C++. I would really like to use java, but I'm not sure real-time is the solution for my problem. Also, I need to decide just how crucial time is for the trading system. It may be that a java implementation of the trading system is faster than a C/C++ due to design, performance tricks and the distributed computing functionality. Also, we are not planning on having the trading system complete all trades autonomously, if at all. Allowing the trading system to be run by AI is how Goldman Sachs and others lost billions recently (Side Note: not sure who convinced the financial giants that AI is a good idea when billions are involved, AI is not ready for this yet; no way to teach the system to truly learn). So, there are more concerns than price alone, I want the right technology for my problem.

Thanks,
14 years ago

Originally posted by Ulf Dittmer:
Interesting indeed. But then you should probably also look into the effects of garbage collection, which may happen at some very inopportune moments, and delay everything in the order of seconds.

There's also a (within limits) real-time JVM from Sun, which I believe used to be a commercial offering, but whose technology is now folded back into the regular JVM. That would presumably have better -or at least more predictable- GC characteristics.



Ha! Earlier today I started another post with GC as the topic.
Yes, GC is concerning. I don't think real-time is freely available.
Hmmm, any info on real-time being part of the regular JVM?

So, I realize C/C++ still has its place and I may right some of the engine using JNI, although I would really like it to be all java.

Thanks for all the info.
14 years ago

Originally posted by Jim Yingst:


I would try to write some good performance tests to measure response times under realistic conditions - or as close to realistic as you can get. Ideally, use a test environment which is a close copy of the production environment, including whatever enterprise server or framework(s) you plan to employ in production. For an application such as you describe, this will be useful for a lot more than just testing this particular optimization idea you have - you want some good, reliable numbers on any performance problems that may come up. Once you've got that, then try writing a simple warmUp() or preloadAllClasses() method to run as part of your engine's initialization, and see if it helps. Like most all performance optimizations, it's very easy to spend time and add complexity on things which don't really help you in the end (and may even harm you), so it's valuable to be able to measure what effects your changes are having.



Thanks for helping conceptualize this! The warmUp() method would be exactly what I had in mind.

Thanks for all the great info.

-Ron
14 years ago
So, when the garbage collection runs everything stops.
Also, even if you ask the garbage collector to run there
is no guarantee that it will run.
This can be very bad, especially if your writing a time sensitive application.

From what I've been taught there is no way to force the garbage collector to run, but here goes my question anyway.

Does anyone have any links, ideas, comments on how to force the garbage collector run or maybe just ensure that it runs with in some amount of time?
(using a normal JVM, I'm not speaking to java real-time here.)


Please let the ideas fly!
14 years ago

Originally posted by Maneesh Godbole:

Scenario 1: Normal Case
main() is invoked and the JVM figures out the classes and dependencies if any and loads them accordingly
Scenario 2: Optimized case
There is a bunch of Class.forNames as the very first instruction set in main and then the code will proceed as Scenario 1.
Isnt the only difference the sequence between these two? Instead of loading the classes as and when required, all of them were loaded initially? Doesnt the time required to load these classes remain the same?

Wheres the advantage then? Unless of course you are talking about something totally different and I have misunderstood.



Here is an example of where I feel "priming" the JVM could help.

Let's say we have a trading system/engine. It constantly hunts for profitable opportunities. Now let's say that we we have loaded and run the JIT on all of our classes except for class Z. Let's also say that class Z is needed to execute a trade which makes us money. Now, our trading system just found trading opportunity, but in order to execute the trade the JVM must load class Z and JIT must run on class Z. This could cost us our opportunity to make money.

Note, what Jim mentions above about class loading and running the JIT is what I'm trying to get at.
14 years ago
Thanks for getting back to me on this.

Jim, thanks for stating what I forgot to state which was the JIT time.

Ulf, I'm not just acting on a hunch. The idea came to me because when I run my app from eclipse the first time it launches 7 seconds and the second time it launches in 2 seconds. Now, I realize what I'm seeing may not be all due to class loading and JIT time, but it got me thinking. Then at JavaOne I had an in depth chat with the Sun JVM developers about java performance and asked them some similar Questions. So, Ulf it is probably slightly more than a hunch, I wish I had more details and data to back up the idea.

So, I'm in a situation where potentially 1ms of time could cost the user 1mil dollars. Every little bit of speed helps.

Also, it seems to me that if you can "prime" the JVM jsut right for your app then you could make your java app faster than a C/C++ app under certain situations. I'm very interested in this.

Thanks to everyone for replying!!!


14 years ago
Hello,

I know that for the most part the JVM loads classes in a lazy manner (on-demand, or as needed). I have an application where I don't want the user to have to wait for any class to be loaded and I'm thinking about "priming" the JVM by forcing all classes to loaded before they are needed. I envision this as either a component of my application or as a separate program all together. The "priming" would be done by explicitly loading every relevant class before they are needed so that class loading doesn't give the user any perceived performance hit.

What do you think?

I'm wondering if I'll break anything? (in terms of security, best practices and like)



Thanks,

-Ron
14 years ago
Sorry about that last post, it was premature and I just noticed the UBB stuff. In true greenhorn fashion here is my addendum to my last post, please ignore the first.

Reid, thanks for the quick useful response.

Here is my response to the questions, please try to do direct me towards
a specific technology.

* Do you want to use XMLSchema or DTDs to define your documents?
Both

* Are only reading/parsing XML docs, or writing XML documents too?
Mostly reading, possibly in the future I may be writing.

* Do you need support for every possible XML document feature, like processing directives?
No.

* Are you processing small numbers of big documents, or big numbers of small documents?
For now, small number of small documents.

* Which deployment environments do you need to support (a big issue with J2EE apps)?
Hmmm, well I would prefer the choice to not limit my ability to turn my code into a J2EE app.<br>

I would like to learn the best one, please chime in with your opinions.

Thanks.
Reid, thanks for the quick useful response<b>
Here is my response the questions, please try to do direct me towards
a specific technology.

* Do you want to use XMLSchema or DTDs to define your documents?
Both
* Are only reading/parsing XML docs, or writing XML documents too?
Mostly reading, possibly in the future I may be writing.
* Do you need support for every possible XML document feature, like processing directives?
No.
* Are you processing small numbers of big documents, or big numbers of small documents?
For now, small number of small documents.
* Which deployment environments do you need to support (a big issue with J2EE apps)?
Hmmm, well I would prefer the choice to limit my ability to turn my code into a J2EE app.<br>

I would like to learn the best one, please chime in with your opinions.

Thanks.
Hello,

I'm trying to find the best way to work with XML and Java. I have
a lot of experience with Java, but this is my first time doing anything with XML. For now I just need to validate the xml and extract the "value" of an element, but eventually I'll be doing more. I have searched around a lot investigating SAX, DOM, JAXB, and Castor. I would like to learn the tool/API that is most accepted and follows standards the closest. What do you think the best choice is out of SAX, DOM, JAXB, Castor and other tools/APIs?

Thanks in advance.

/ron