I have created one java-swing application.
The application runs perfectly runs perfect on my pc. But it doesn't run perfectly on client pc.I had increase my Virtual Memory, earlier on my pc. So my question is..
Is changing memory limit, effect or change application behavior?
Is there anything that change the behavior of java application? bcz same application runs perfectly on my pc and same application does not running perfectly on client pc? and there is no problem in code, i have checked three times.EDIT:
This is one screen shot of my application, if u see in the screen shot there is one table in which there are many images in it. Now on my pc i don't see any double images in that table. But on client pc, i am seeing double images in that table but if u click on one of the images then after clicking , the image which is showing earlier changed. now then i take database and all the images from client pc and then i tried to run the same application on my pc with same data which is also their on client machine.But now there is no double imag开发者_运维技巧es coming in that table on my pc.
i "increase my virtual memory" means changing the heap size of virtual memory of jvm by adding...
java -Xmx512m
- Obviously, if you app runs into
OutOfMemoryError
, then increasing the maximum heap size can fix it. - Faulty (on the hardware level) memory can cause Java programs to crash. This can be diagnosed by using a memtest tool
- Sometimes, Swing gets at odds with hardware graphics acceleration, especially with onboard graphics adpaters that share main memory. This can be fixed either by reducing hardware acceleration in Windows, or getting new drivers.
It's possible more memory to help. To optimize anything for better performance/scaling/size, you first need to understand the problem.
Examine how much memory your application uses - if you're on windows you can start by looking at it with task explorer. If the amount of memory used is a significant portion of the amount of memory your pc has, then adding more memory may well speed things up. Other things can affect performance such as hard disk speed and number of cpu's. You could add more memory, but find it's the hard disk speed that is the problem.
What kind of things does your program do. Does it work with files or large data-sets?
You haven't said how it doesn't run perfectly on the client's pc. Is it slow, or does it crash?
Changes in the amount of memory and thus possibly in the amount of swapping necessary to provide memory to all applications can change the timing of your program.
If your program is susceptible to timing changes (i.e. if it is timing-dependent or only works in "best-case" timing), then those timing changes can influence the behaviour of your application.
Additionally restricted memory constraints can lead to more frequent garbage collection which also change the timing and can have an additional influence if you use any kinds of weak or soft references in your application.
You must check if the problem is with memory. Use ProcessManager or other similar program to check how your program use memory from OS point of view. You can use jconsole
to check, how it looks from Java perspective.
Run your application with JDK and add to its invocation:
-Dcom.sun.management.jmxremote.port=9876 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false
Then run jconsole
and watch your app.
精彩评论