hello
I am developing a java application, in my application i have to move data with large size from one object to another and i don't know the perfect way to do it so i can save memory and increase the processing speed because performance is very important in my project.
please can you tell me which scenario is better and why:
1-to include the large data in an string object for ex. and then send the reference of the object to the other object.
2-to save the large data in an file and to send the location of the file to the other object so the other object can read the file and process data.
what cost more saving and reading data in/from the file or transmitting the object referencing to the data from place to place.
misszeze
0
Newbie Poster
Recommended Answers
Jump to Post"move data with large size from one object to another"? Move or just get access to? How large? Objects in the same JVM? Different JVMs on the same machine? Two machines in the same network?
In general trying to optimise code before its working ("premature optimisation") is a waste …
Jump to PostYou can't send a ref between different JVMs, but why have 2 JVMs?
If they really are different JVMs the your choices include a file or a socket connection. 500KB is a very small amount of data so either way it's all going to be in in-memory buffers.
All 8 Replies
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
misszeze
0
Newbie Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
misszeze
0
Newbie Poster
~s.o.s~
2,560
Failure as a human
Team Colleague
Featured Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
~s.o.s~
2,560
Failure as a human
Team Colleague
Featured Poster
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.