0

Consuming Filedescroptors per Include / ZUL inside a JAR

asked 2012-09-21 15:41:58 +0800

CodeWarrior gravatar image CodeWarrior
9

Hi @all

I got a question for all of you.

I wrote a Portal (ZK CE 5.0.7) which has the ability to start varios Applications. Each application is a JAR file which contains varios ZUL files, java, img etc.

The main Window of each Application is created over
Codesnippet

    InputStream zulInput = this.getClass().getResourceAsStream(cUrl) ;
    if(zulInput == null) {
       Messagebox.show("The program "+cName+" is not available!");
       return;
     }

     Reader zulReader = new InputStreamReader(zulInput) ;
     oApp = (AppWindow) Executions.createComponentsDirectly(zulReader,"zul", _oMainLayout.getoInnerCenterDiv(), paramMap);
     zulReader.close();
     zulInput.close();


Note: AppWindow is my Class extends Window

each ZUL used after the main window contains the include TAGs for "internal" use inside of each Application.

for example, like that:

     <window
        xmlns:w="http://www.zkoss.org/2005/zk/client"
        id="winMainWindow"
        mode="overlapped"
        sizable="true"
        width="100%"
        height="100%"
        layout="${arg.layout}"
        taskbar="${arg.taskbar}"
        user="${arg.user}"
        superParent="${self}"
        desktop="${arg.portalDesktop}"
        closable="true"
        maximizable="false"
        minimizable="false"
        use="com.example.MainWindow">

       <include mode="instant" id="includeCalendar" width="100%" height="100%"
                         src="~./calendar/PanelCalendar.zul"
                         superParent="${winMainWindow}"
                         layout="${arg.layout}"
                         taskbar="${arg.taskbar}"/>

      </window>

   

Here comes my observation:
I noticed that on my server
Linux version 2.6.18-194.el5 (mockbuild@x86-005.build.bos.redhat.com) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)) #1 SMP Tue Mar 16 21:52:39 EDT 2010

and my Tomcat
apache-tomcat-6.0.29

When I run
ls -la /proc/4143/fd|grep -E '[0-9]\.' |awk '{print $11}' |sort -n|nl
which gives me all of the filedescriptors used by my process 4143

I noticed that I get a lot more Filedescriptors that I have connections to my server, which are btw around 200 tops but at
the time I executed this comment I had only 60.

Snippet
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/MainApplication.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/timelinez.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/timeplotz.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/transport.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/transportPLM.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/transportPT.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/transportSM.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/woden-api-1.0M8.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/woden-impl-dom-1.0M8.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/wsdl4j-1.6.2.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/wstx-asl-3.2.4.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/XmlSchema-1.4.3.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/xom-1.1d2.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/xstream-1.3.1.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/zcommon.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/zcommons-el.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/zhtml.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/zk.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/zkplus.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/zul.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/zul.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/zul.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/zul.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/zul.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/zul.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/zul.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/zul.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/zul.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/zul.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/zul.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/zul.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/zul.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/zul.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/zul.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/zul.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/zul.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/zul.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/zul.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/zul.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/zul.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/zul.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/zul.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/zul.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/zul.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/zul.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/zul.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/zul.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/zul.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/zul.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/zul.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/zul.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/zul.jar
/opt/apache-tomcat-6.0.29/webapps/Portal/WEB-INF/lib/zweb.jar

Finally here comes the question. does an include in a ZUL
consume a Filedescriptor for each include / ZUL ???

Why is that and how can I prevent that ?

any comments are welcome !

Thanks in advance !

Patrick

delete flag offensive retag edit

2 Replies

Sort by ยป oldest newest

answered 2012-09-24 19:34:55 +0800

CodeWarrior gravatar image CodeWarrior
9

anybody ???

Seems like Includes in zul opens FileDescriptor for each one !

some help, please !

link publish delete flag offensive edit

answered 2013-10-28 02:02:19 +0800

paowang gravatar image paowang
140 6

How can I reproduce this case? Can you provide some code for reproducing?

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
2 followers

RSS

Stats

Asked: 2012-09-21 15:41:58 +0800

Seen: 127 times

Last updated: Oct 28 '13

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More