I have an application that writes some data (about 15mb in 80k tuples) into an SQLite database using this jdbc-driver on Mac OS X. This is done using transactions, the largest of which contains about 45k inserts into one table. When profiling the application, several things seems strange:
System.in.read()
, the memory allocated by the process keeps growing slowly. Why is that? Thanks for any help.
The jigsaw pattern in memory usage is due to the profiling results being transmitted over RMI. This is indeed very confusing and annoying to filter from real memory allocations by your program. See VisualVM profiling is polluting results to find out how to filter these :-)
With regards to your first issue, how long of a time slice did you observe the slow growth over. When memory usage is quiescent in a Java process you'll typically see a sawtooth pattern develop. Did you see any GC's occur in the same time slice? If not, then thats more evidence that supports this idea.
For problem number two, it's really hard to say for certain without more information. You would typically expect the application behaivor to differ when profiling is turned on because timing windows change, the application has to spend time reporting data and doing its normal work, etc. It could be that when profiling is turned on, more memory allocations happen because your code is now instrumented, and this triggers a GC which lowers the heap usage. Try doing a System.gc() in your application when profiling is turned off and tell us what your heap usage reports.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.