2013年10月31日星期四

java read sqlserver database image data types cause memory overflow

java read sqlserver database attachments. Accessories have an Image field is attachment content type, size greater than 30M.
when reading data out of memory .
read attachments bean:

public class Uattach {

private Long attachID;

private Long belongtoFileID;

private String attachName;

private String refuser;

private byte[] fileContent;

private Long createdBy;

private Date createdDate;

private Long lockedID;}

using apache open source DButil linked databases .
Is there any way to read the attachments do not cause a memory leak ?
------ Solution ---------------------------------------- ----

through death does not exist , these pieces of data read-once .                
your jvm parameters is how , how much memory is allocated .          
jvm memory is the default , myeclipse parameters are as follows :   
-vmargs   
-Xmx512m   
-XX: MaxPermSize = 512m   
-XX: ReservedCodeCacheSize = 64m  
big points out first try.
------ For reference only -------------------------------------- -
30M to memory overflow ? ? ? I think it is unlikely , if there is an infinite loop .
------ For reference only -------------------------------------- -

through death does not exist , these pieces of data read-once .
------ For reference only -------------------------------------- -

through death does not exist , these pieces of data read-once .  
your jvm parameters is how , how much memory is allocated .
------ For reference only -------------------------------------- -

through death does not exist , these pieces of data read-once .          
your jvm parameters is how , how much memory is allocated .  
jvm memory is the default , myeclipse parameters are as follows :
-vmargs
-Xmx512m
-XX: MaxPermSize = 512m
-XX: ReservedCodeCacheSize = 64m
------ For reference only ---------------------------- -----------
you use the stream read out ?
------ For reference only -------------------------------------- -

read out by flow effect is the same . Also overflowed
------ For reference only ----------------------------------- ----

through death does not exist , these pieces of data read-once .                      
your jvm parameters is how , how much memory is allocated .                
jvm memory is the default , myeclipse parameters are as follows :     
-vmargs     
-Xmx512m     
-XX: MaxPermSize = 512m     
-XX: ReservedCodeCacheSize = 64m          
big points out first try.  
not OK .
------ For reference only -------------------------------------- -

through death does not exist , these pieces of data read-once .                            
your jvm parameters is how , how much memory is allocated .                      
jvm memory is the default , myeclipse parameters are as follows :       
-vmargs       
-Xmx512m       
-XX: MaxPermSize = 512m       
-XX: ReservedCodeCacheSize = 64m                
big points out first try.          
not OK .  
solved the problem. In myeclipse set on a little run-time memory to get.

没有评论:

发表评论