-
1. Re: FileUpload keepalive memory issue
andrei_exadel Feb 23, 2009 12:14 PM (in response to b_ravi_kiran)Hi,
I tried to upload a lot of files in flash mode and I didn't see that server's memory heap was increased. Seems that fileupload component is not a cause of the problem.
Please try to test without resizing. -
2. Re: FileUpload keepalive memory issue
b_ravi_kiran Feb 23, 2009 12:55 PM (in response to b_ravi_kiran)Thank you very much andrei for your prompt response. I shall try your suggestion and get back to you with the results
Ravi Kiran Bhaskar
Principal Software Engineer
Washington Post Digital
1515 N Courthouse Rd. Arlington, VA 22201 -
3. Re: FileUpload keepalive memory issue
b_ravi_kiran Feb 23, 2009 1:40 PM (in response to b_ravi_kiran)OK andrei here are the results without resizing (Instead of resizing I just copied the files as is to a destination folder in docroot of the server). I was testing this on a sun java application server 9.1 which did not have any other application apart from my app still I see jump in memory usage. Can you tell me when will the AjaxStateManager/AjaxStateHolder clear the cache? I see the same memory even after the session has expired and even if I closed the window. The results are as follows
before uploading the 'top' showed me the following
load averages: 0.01, 0.05, 0.20; up 117+01:05:13 13:27:05
38 processes: 37 sleeping, 1 on cpu
CPU states: 98.9% idle, 0.0% user, 1.1% kernel, 0.0% iowait, 0.0% swap
Memory: 8192M real, 5435M free, 2631M swap in use, 20G swap free
PID USERNAME LWP PRI NICE SIZE RES STATE TIME CPU COMMAND
5635 wlogic 101 59 0 2791M 1593M sleep 7:47 0.05% java
After uploading 21.8 MB worth of photographs the 'top' shouwed me the following..
load averages: 0.64, 0.40, 0.27; up 117+01:14:40 13:36:32
38 processes: 37 sleeping, 1 on cpu
CPU states: 99.5% idle, 0.0% user, 0.3% kernel, 0.2% iowait, 0.0% swap
Memory: 8192M real, 5316M free, 2635M swap in use, 20G swap free
PID USERNAME LWP PRI NICE SIZE RES STATE TIME CPU COMMAND
5635 wlogic 103 59 0 2795M 1714M sleep 9:11 2.23% java -
4. Re: FileUpload keepalive memory issue
andrei_exadel Feb 24, 2009 5:50 AM (in response to b_ravi_kiran)Ravi,
I think that if state is hold in session scope it should be cleared after session terminated.
I see that you have memoty encresed after upload, but i still cannot reproduce this. I used tomcat 6 for the test and uploaded a ot of MBs to server. My javaw.exe process still takes memoty heap that it took before upload. Sometimes memory heap increases and then does not clear.
I think that stateManager is not a cause of the problem. I think JVM keeps already ordered memory for next usage if server allows it. And it should not be cause of server failed after long running time.
I can suggest you to perform load test of your application to investigate behavior of memoty heap in case of a lot of concurrent users.
Best regards. -
5. Re: FileUpload keepalive memory issue
b_ravi_kiran Feb 24, 2009 1:46 PM (in response to b_ravi_kiran)Thnaks andrei for your reply. I shall do profiling of my code. I did another test
FYI when I removed keepalive for the uploaderbean and made it immediateupload=true with request scope, The fileUploadListener processed files one by one and sent it through the same Image Magick resizing code with no memory jump, that is why I was thinking that it could be related to keepalive state.