This week's book giveaway is in the Open Source forum.
We're giving away four copies of Programmers Guide to Apache Thrift and have Randy Abernethy on-line!
See this thread for details.
Win a copy of Programmers Guide to Apache Thrift this week in the Open Source forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

What does JVM of every user store?  RSS feed

 
Ranch Hand
Posts: 203
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since every client who is accessing a java application has a JRE that consists JVM. So
  • What does JVM of every client store? Does it store objects as JVM of Server?
  • In a running web application which is being accessed by thousands of users, when a user accesses it, do the classes get loaded for every particular user (as every JRE has a classloader) or the classes are already loaded in Server's JVM?
  • [/list]
     
    Marshal
    Posts: 64471
    225
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Afraid I don't understand this question. Does the JVM store anything? What if you have programmed writing things in files or into a database? Does that count?
     
    Bartender
    Posts: 20721
    124
    Android Eclipse IDE Java Linux Redhat Tomcat Server
    • Likes 1
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    The question makes no sense. Clients are not necessarily running Java and therefore have no need of either JRE or JVM (which are 2 different things). A client can be a web browser written in C, for example.

    A JVM is a Java Virtual Machine. It is a program that runs Java code. A JRE is a Java Runtime Environment and it's the JVM program file, plus all of the other support files needed to run Java, including the core classes.

    A Java web server is probably not running under a JRE, however. It usually requires the full Java Developer's Kit (JDK). While recent changes by Oracle are breaking this long distinction, traditionally, a JDK had a JRE embedded within it, but added the necessary extra files such as the Java compiler itself, which isn't part of a traditional JRE.

    A Java web server contains multiple classpaths. There will be one for each deployed web application, one for the server itself, and often one or more for various server internal subsystems. Each classpath component anchors it own class instances. The webapp classpaths actually extend the core server classpath, so there will be one and only one instance of the class java.lang.String for all classpaths (Note that this is the class, I'm not talking about String instances!).

    But if, for example, you had 2 webapps using log4j, that would come from their unique classpaths build from their WEB-INF/classes and WEB-INF/libs directories, so there'd be separate copies of the log4 classes in each webapp.

     
    Arun Singh Raaj
    Ranch Hand
    Posts: 203
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Thanks for responding.
    I'm sorry for this stupid question, when I read JRE is required for every client machine to run java app, it was for desktop app, I misunderstood it. I got it. Thanks.
     
    Campbell Ritchie
    Marshal
    Posts: 64471
    225
    • Likes 1
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Yes, you would have a server running a JRE, and each client would require a JRE if you pass Java® code to them. Most people, however, would only expose PHP/JS/similar code on the website, rather than Java®. If that happens, the clients woulldn't run any Java® code.
     
    Here. Have a potato. I grew it in my armpit. And from my other armpit, this tiny ad:
    ScroogeXHTML - small and flexible RTF to HTML converter library
    https://coderanch.com/t/710903/ScroogeXHTML-RTF-HTML-XHTML-converter
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!