0

I am using adobe flex4.6 and blazeds4.0 to communicate with server. Client makes RMI with server. Server returns an arrayList which is composed of user defined class objects. Assume 200000 objects are added in arrayList . When this arrayList is returned to the blazeds it consumed huge memory in JVM and also the memory usage for that client web browser also increased. Moreover the occupied huge memory is not garbage collected in JVM. This finally results in out of memory error as more request comes in. Below listed is a sample code for sending an arrayList to blazeds. SampleClass class has 3 variables each of type int with getters and setters.

List list = new ArrayList();
for(i=0;i<200000;i++)
{ SampleClass  sampleClassObj = new SampleClass();
  sampleClassObj.setId(1);
  sampleClassObj.setAge(20);
  sampleClassObj.setEmpId(100);
  list.add(sampleClassObj);
} 

return list;

Kindly reply with an immediate solution to avoid consuming huge memory in blazeds and also garbage collect that memory.

thameem
  • 21
  • 2
  • 200000 objects at single shot seems to be very large. Why not to send it in some batches? My suggestion – Pradeep Simha Feb 12 '13 at 12:09
  • Even if i send 2000 objects blazeds still consumes a lot more memory than the actual memory of arrayList. For Ex if the arrayList consumes 5Mb then the blazeds consumes about 100Mb in JVM. – thameem Feb 12 '13 at 12:21

0 Answers0