You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Jerome Camilleri <je...@bull.net> on 2007/06/18 16:24:42 UTC

Too many open file with Axis2 1.2

Hi,

I used client Axis2 1.2 to send file attached to my WebService.
On my client, I used the 
ConfigurationContextFactory.createConfigurationContextFromFileSystem 
with a repository containing modules like addressing and sandesha2.
My deamon scan a directory to send the message and create for eatch a 
new configurationContext and a new stub.
After eatch sending I call methods to clear the memory (see the end of 
this mail) but it seems that some files is lock by my deamon because 
after about 300 calls my system is very slow and client stop with the 
message "can't open file : Too many open file" in the console (ulimit -n 
= 1024)

When I launch the lsof command, I noticed that 4 files is adding for one 
file sending
 lsof | grep /tmp/axis2        
java      21584    camillej   86r      REG        3,3   352079      
76659 /tmp/axis244513sandesha2-1.2.mar
java      21584    camillej   87r      REG        3,3    37572      
76658 /tmp/axis244512addressing-1.2.mar
java      21584    camillej   88r      REG        3,3     8379      
76660 /tmp/axis244514soapmonitor-1.2.mar
java      21584    camillej   89r      REG        3,3     1444      
76661 /tmp/axis244515version.aar

So my client finally code :
                HashMap listeModuleDesc = 
configurationContext.getAxisConfiguration().getModules();
                Iterator itListeModuleDesc = 
listeModuleDesc.keySet().iterator();

                while(itListeModuleDesc.hasNext())
                {
                    String moduleDescId = (String)itListeModuleDesc.next();
                    AxisModule moduleDesc = 
(AxisModule)listeModuleDesc.get(moduleDescId);
                    if (moduleDesc != null) {
                        Module module = moduleDesc.getModule();
                        if (module != null) {
                            module.shutdown(configurationContext);
                        }
                        
configurationContext.getAxisConfiguration().disengageModule(moduleDesc);
                    }
                }

                if (stub != null) {
                    stub.cleanup();
                 }

                if (configurationContext != null) {
                    configurationContext.cleanupContexts();
                    configurationContext.terminate();
                }

                stub = null;
                configurationContext = null;

Can someone I have an idea about my problem... ?

Regards

Jérôme


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Too many open file with Axis2 1.2

Posted by Jerome Camilleri <je...@bull.net>.
Davanum Srinivas wrote:
> Please don't call createConfigurationContextFromFileSystem multiple
> times. just call once when the daemon starts.
thanks for this workaround...but don't you think that we should have a 
way to clean up the ressources used by the ConfigurationContext ?

Regards

Jérôme

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Too many open file with Axis2 1.2

Posted by Davanum Srinivas <da...@gmail.com>.
Please don't call createConfigurationContextFromFileSystem multiple
times. just call once when the daemon starts.

thanks,
dims

On 6/18/07, Jerome Camilleri <je...@bull.net> wrote:
> Hi,
>
> I used client Axis2 1.2 to send file attached to my WebService.
> On my client, I used the
> ConfigurationContextFactory.createConfigurationContextFromFileSystem
> with a repository containing modules like addressing and sandesha2.
> My deamon scan a directory to send the message and create for eatch a
> new configurationContext and a new stub.
> After eatch sending I call methods to clear the memory (see the end of
> this mail) but it seems that some files is lock by my deamon because
> after about 300 calls my system is very slow and client stop with the
> message "can't open file : Too many open file" in the console (ulimit -n
> = 1024)
>
> When I launch the lsof command, I noticed that 4 files is adding for one
> file sending
>  lsof | grep /tmp/axis2
> java      21584    camillej   86r      REG        3,3   352079
> 76659 /tmp/axis244513sandesha2-1.2.mar
> java      21584    camillej   87r      REG        3,3    37572
> 76658 /tmp/axis244512addressing-1.2.mar
> java      21584    camillej   88r      REG        3,3     8379
> 76660 /tmp/axis244514soapmonitor-1.2.mar
> java      21584    camillej   89r      REG        3,3     1444
> 76661 /tmp/axis244515version.aar
>
> So my client finally code :
>                 HashMap listeModuleDesc =
> configurationContext.getAxisConfiguration().getModules();
>                 Iterator itListeModuleDesc =
> listeModuleDesc.keySet().iterator();
>
>                 while(itListeModuleDesc.hasNext())
>                 {
>                     String moduleDescId = (String)itListeModuleDesc.next();
>                     AxisModule moduleDesc =
> (AxisModule)listeModuleDesc.get(moduleDescId);
>                     if (moduleDesc != null) {
>                         Module module = moduleDesc.getModule();
>                         if (module != null) {
>                             module.shutdown(configurationContext);
>                         }
>
> configurationContext.getAxisConfiguration().disengageModule(moduleDesc);
>                     }
>                 }
>
>                 if (stub != null) {
>                     stub.cleanup();
>                  }
>
>                 if (configurationContext != null) {
>                     configurationContext.cleanupContexts();
>                     configurationContext.terminate();
>                 }
>
>                 stub = null;
>                 configurationContext = null;
>
> Can someone I have an idea about my problem... ?
>
> Regards
>
> Jérôme
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


-- 
Davanum Srinivas :: http://davanum.wordpress.com

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org