9

Are the XML files in the classpath of a java application always loaded into memo...

 3 years ago
source link: https://www.codesd.com/item/are-the-xml-files-in-the-classpath-of-a-java-application-always-loaded-into-memory.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Are the XML files in the classpath of a java application always loaded into memory?

advertisements

I have some configuration XML files in the classpath of a library project. Are these XML files always in main memory when the application ist running?

Additional Question: If not, how can i keep an XML file always in main memory?


No file in classpath is loaded automatically, even class files need a reason to be loaded. You have to use getResource or getResourceAsStream to access XML files. Then, it is unlikely you want to keep them in memory as byte or character arrays - better to convert them in more usable format.

If your application is executed under control of some web-container or application server, use its facilities to read configuration files.

Related Articles

Objective-C: Are all string literals always loaded into memory?

In UIViewController subclasses, I often see: - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { self.title = NSLocalizedString(@"Home"

How to get the classpath of a Java application running on webstart?

My Java application, deployed via webstart, invokes a helper application. I want to start the helper application in a separate JVM with the the same classpath as the main application. Without webstart, the system ClassLoader provides an answer. With

Where are the logs of my Java application?

I am logging issues at my application like that: private static Logger logger = LoggerFactory.getLogger(Student.class); ... logger.info(msg); logger.debug(another_msg); I use Java and Spring framework running on Apache Tomcat 6 and slf4j for logging.

When is the file loaded into memory - for fread, fopen, and fwrite calls?

When I do a fopen and then a fread, when is the file actually/partially loaded in the memory during fopen or fread? Or is it partially loaded at fopen based on size of file and then fully loaded at time of fread? Similarly what happens internally at

What are the fundamental differences between Java and C # in terms of internal / local / anonymous classes?

What are the fundamental differences between Java and C# in terms of inner/local/anonymous classes?C# doesn't have the equivalent of Java inner classes - it only has nested types (like Java's "static" nested classes). The access rules are slight

How many program / class copies are loaded into memory when multiple users access it at the same time

We are trying to setup Eclipse in a shared environment, i.e., it will be installed on a server and each user connects to it using VNC. There are different reasons for sharing Eclipse, one being proper integration with ClearCase. We identified that Ec

How can the jsp page be loaded into memory at once?

Suppose my web application contain multiple jsp pages and other servlet and html.....files. So while am executing the web application how many jsp file at a time will loaded into memory? Anyone could you please help me on this....That entirely depend

The index will be fully loaded into memory

I am wondering whether the index will be fully loaded into memory or not?The answer to this is in several parts: The size of the index. What parts are accessed. Memory pressure. I had a huge index on a table that took SQL Server a full 3 minutes to r

What is the maximum size of a DataTable that I can load into memory in .Net?

What is the maximum size of a DataTable I can load into memory in .Net? Is there an artificial limitation, or it is only limited by the box I am running the code on?While I'm not sure of the memory footprint, there is a maximum number of rows. From M

You want to analyze the XML file in MySQL (using predefined functions / procedures) and insert it into the table

I have a XML File pasted below. I want to parse it in MySQL. 1) I referred some link[1] in which first we have to load the XML file and insert it in the table. [1] - https://dev.mysql.com/doc/refman/5.5/en/load-xml.html 2) And also I read that fetch

What are the best practices for changing application windows in Qt?

I have an application with the following UI forms deriving from QMainWindow LoginWindow TasksWindow DetailsWindow I'm supposed to login into the application in the LoginWindow where I will move to the TasksWindow. In the TasksWindow, I will choose an

What are the components of a Web application?

As far as I understand a web application is a rich, dynamic webpage, containsing lots of user-generated content, achieved via certain code behind the static webpage. What are the key components of the above? Is it OK to say that you require a standar

JQuery - What are the differences between $ (document) .ready and $ (window) .load?

What are differences between $(document).ready(function(){ //my code here }); and $(window).load(function(){ //my code here }); And I want to make sure that: $(document).ready(function(){ }) and $(function(){ }); and jQuery(document).ready(function()

Counting the number of rows in a CSV file without loading into memory

I have a CSV file that is extremely large, roughly 50k+ lines. I use CHCSVParser to parse it all line by line which works fine. I would like to display some type of progress to the user as the data is parsed and added into CoreData. If I know the num

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK