<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    On 10/08/2010 19:53, David Conde wrote:
    <blockquote
      cite="mid:AANLkTinukYFeKg5-eBQ8DBFJKx_yZg-aoXQu5ikCDF9e@mail.gmail.com"
      type="cite">Just to let people know, I've worked around this by
      only creating one SessionConfig object and caching it i.e
      "StatelessKnowledgeSession ksession =
kbase.newStatelessKnowledgeSession((KnowledgeSessionConfiguration)getSessionConfig());".&nbsp;
      <div>
        <br>
      </div>
      <div>What seemed to be happening was ChainedProperties was trying
        Classloader lookups that were very slow when running in an OSGi
        environment.
        <div><br>
        </div>
        <div>Also with how the OSGi bundles are built the org.drools
          package is split and it makes it difficult to load up certain
          classes. I ended up having to use reflection to load up the
          SessionConfiguration class from a specific bundle. Maybe it's
          to do with how I'm importing the drools bundles into my
          project but it's one to watch out for if your using drools
          with OSGi.</div>
      </div>
    </blockquote>
    in general you shouldn't be looking up concrete implementations,
    just using what the factory services provide in drools-api; so the
    split packages shouldn't impact. I made a few of the services
    avaiable as osgi factory services, see docs for more details.<br>
    <br>
    Mark<br>
    <blockquote
      cite="mid:AANLkTinukYFeKg5-eBQ8DBFJKx_yZg-aoXQu5ikCDF9e@mail.gmail.com"
      type="cite">
      <div>
        <div><br>
        </div>
        <div>Thanks,</div>
        <div>Dave&nbsp;<br>
          <br>
          <div class="gmail_quote">On 10 August 2010 17:46, David Conde
            <span dir="ltr">&lt;<a moz-do-not-send="true"
                href="mailto:dconde@calomtech.com">dconde@calomtech.com</a>&gt;</span>
            wrote:<br>
            <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
              0.8ex; border-left: 1px solid rgb(204, 204, 204);
              padding-left: 1ex;">
              ChainedProperties lives
              in&nbsp;org.drools.util.ChainedProperties and is created in
              SessionConfiguration(). The call is called
              during&nbsp;StatelessKnowledgeSession ksession =
              kbase.newStatelessKnowledgeSession();.
              <div>
                <div class="h5">
                  <br>
                  <br>
                  <div class="gmail_quote">
                    On 10 August 2010 17:36, Pavel Tavoda <span
                      dir="ltr">&lt;<a moz-do-not-send="true"
                        href="mailto:pavel.tavoda@gmail.com"
                        target="_blank">pavel.tavoda@gmail.com</a>&gt;</span>
                    wrote:<br>
                    <blockquote class="gmail_quote" style="margin: 0pt
                      0pt 0pt 0.8ex; border-left: 1px solid rgb(204,
                      204, 204); padding-left: 1ex;">
                      Can't you avoid using ChainedProperties, what is
                      it? Can you send<br>
                      piece of code where you create session?<br>
                      <br>
                      Pavel<br>
                      <br>
                      <br>
                      2010/8/10 David Conde &lt;<a
                        moz-do-not-send="true"
                        href="mailto:dconde@calomtech.com"
                        target="_blank">dconde@calomtech.com</a>&gt;:<br>
                      <div>
                        <div>&gt; Hi Pavel,<br>
                          &gt; I've changed it over to use a stateless
                          session and I'm seeing the<br>
                          &gt; same&nbsp;behavior. I've done some debugging
                          and it seems to be very slow loading<br>
                          &gt; up the SessionConfiguration due to all of
                          the loading that happens in<br>
                          &gt; ChainedProperties.<br>
                          &gt; Thanks,<br>
                          &gt; Dave<br>
                          &gt;<br>
                          &gt; On 10 August 2010 13:53, Pavel Tavoda
                          &lt;<a moz-do-not-send="true"
                            href="mailto:pavel.tavoda@gmail.com"
                            target="_blank">pavel.tavoda@gmail.com</a>&gt;
                          wrote:<br>
                          &gt;&gt;<br>
                          &gt;&gt; Interesting. Normally it should be
                          fast. Try to change your patter and<br>
                          &gt;&gt; load binary compiled serialized
                          package from disk. You can find it in<br>
                          &gt;&gt; documentation.<br>
                          &gt;&gt; Also consider using stateless
                          session. Do you really need stateful<br>
                          &gt;&gt; session?<br>
                          &gt;&gt;<br>
                          &gt;&gt; Pavel<br>
                          &gt;&gt;<br>
                          &gt;&gt; 2010/8/9 David Conde &lt;<a
                            moz-do-not-send="true"
                            href="mailto:dconde@calomtech.com"
                            target="_blank">dconde@calomtech.com</a>&gt;:<br>
                          &gt;&gt; &gt; Is it possible that this might
                          be invoking the compiler when a session<br>
                          &gt;&gt; &gt; is<br>
                          &gt;&gt; &gt; created? I have all of the init
                          code in the service start call and<br>
                          &gt;&gt; &gt; stored as<br>
                          &gt;&gt; &gt; members of the service for reuse
                          but I must create a new knowledge<br>
                          &gt;&gt; &gt; session<br>
                          &gt;&gt; &gt; for each run.<br>
                          &gt;&gt; &gt; Any ideas?<br>
                          &gt;&gt; &gt; Thanks,<br>
                          &gt;&gt; &gt; Dave<br>
                          &gt;&gt; &gt;<br>
                          &gt;&gt; &gt; ---------- Forwarded message
                          ----------<br>
                          &gt;&gt; &gt; From: David Conde &lt;<a
                            moz-do-not-send="true"
                            href="mailto:dconde@calomtech.com"
                            target="_blank">dconde@calomtech.com</a>&gt;<br>
                          &gt;&gt; &gt; Date: 9 August 2010 11:17<br>
                          &gt;&gt; &gt; Subject: Re: [rules-users] CPU
                          Spike creating a StatefulKnowledgeSession<br>
                          &gt;&gt; &gt; using OSGi<br>
                          &gt;&gt; &gt; To: Rules Users List &lt;<a
                            moz-do-not-send="true"
                            href="mailto:rules-users@lists.jboss.org"
                            target="_blank">rules-users@lists.jboss.org</a>&gt;<br>
                          &gt;&gt; &gt;<br>
                          &gt;&gt; &gt;<br>
                          &gt;&gt; &gt; The line that it spikes on
                          is&nbsp;StatefulKnowledgeSession ksession =<br>
                          &gt;&gt; &gt;
                          kbase.newStatefulKnowledgeSession();.<br>
                          &gt;&gt; &gt; Cheers,<br>
                          &gt;&gt; &gt; Dave<br>
                          &gt;&gt; &gt;<br>
                          &gt;&gt; &gt; On 9 August 2010 11:09, Pavel
                          Tavoda &lt;<a moz-do-not-send="true"
                            href="mailto:pavel.tavoda@gmail.com"
                            target="_blank">pavel.tavoda@gmail.com</a>&gt;
                          wrote:<br>
                          &gt;&gt; &gt;&gt;<br>
                          &gt;&gt; &gt;&gt; Is it session creation or
                          rule compilation?<br>
                          &gt;&gt; &gt;&gt;<br>
                          &gt;&gt; &gt;&gt; Pavel<br>
                          &gt;&gt; &gt;&gt;<br>
                          &gt;&gt; &gt;&gt; 2010/8/9 David Conde &lt;<a
                            moz-do-not-send="true"
                            href="mailto:dconde@calomtech.com"
                            target="_blank">dconde@calomtech.com</a>&gt;:<br>
                          &gt;&gt; &gt;&gt; &gt; Good Morning,<br>
                          &gt;&gt; &gt;&gt; &gt; I now have drools
                          running on the Spring DM-Server but I am
                          seeing a<br>
                          &gt;&gt; &gt;&gt; &gt; CPU<br>
                          &gt;&gt; &gt;&gt; &gt; spike when creating
                          a&nbsp;StatefulKnowledgeSession. I've tested this<br>
                          &gt;&gt; &gt;&gt; &gt; outside<br>
                          &gt;&gt; &gt;&gt; &gt; of<br>
                          &gt;&gt; &gt;&gt; &gt; an OSGi environment and
                          I don't see the spike. Does anyone know any<br>
                          &gt;&gt; &gt;&gt; &gt; settings<br>
                          &gt;&gt; &gt;&gt; &gt; that I can change that
                          might make this go away?<br>
                          &gt;&gt; &gt;&gt; &gt; Thanks,<br>
                          &gt;&gt; &gt;&gt; &gt; Dave<br>
                          &gt;&gt; &gt;&gt; &gt;<br>
                          &gt;&gt; &gt;&gt; &gt; --<br>
                          &gt;&gt; &gt;&gt; &gt; David Conde<br>
                          &gt;&gt; &gt;&gt; &gt; CTO Calom Technologies<br>
                          &gt;&gt; &gt;&gt; &gt;<br>
                          &gt;&gt; &gt;&gt; &gt;<br>
                          &gt;&gt; &gt;&gt; &gt;
                          _______________________________________________<br>
                          &gt;&gt; &gt;&gt; &gt; rules-users mailing
                          list<br>
                          &gt;&gt; &gt;&gt; &gt; <a
                            moz-do-not-send="true"
                            href="mailto:rules-users@lists.jboss.org"
                            target="_blank">rules-users@lists.jboss.org</a><br>
                          &gt;&gt; &gt;&gt; &gt; <a
                            moz-do-not-send="true"
                            href="https://lists.jboss.org/mailman/listinfo/rules-users"
                            target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
                          &gt;&gt; &gt;&gt; &gt;<br>
                          &gt;&gt; &gt;&gt; &gt;<br>
                          &gt;&gt; &gt;&gt;<br>
                          &gt;&gt; &gt;&gt;
                          _______________________________________________<br>
                          &gt;&gt; &gt;&gt; rules-users mailing list<br>
                          &gt;&gt; &gt;&gt; <a moz-do-not-send="true"
                            href="mailto:rules-users@lists.jboss.org"
                            target="_blank">rules-users@lists.jboss.org</a><br>
                          &gt;&gt; &gt;&gt; <a moz-do-not-send="true"
                            href="https://lists.jboss.org/mailman/listinfo/rules-users"
                            target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
                          &gt;&gt; &gt;<br>
                          &gt;&gt; &gt;<br>
                          &gt;&gt; &gt;<br>
                          &gt;&gt; &gt;<br>
                          &gt;&gt; &gt;<br>
                          &gt;&gt; &gt;<br>
                          &gt;&gt; &gt;<br>
                          &gt;&gt; &gt;<br>
                          &gt;&gt; &gt;
                          _______________________________________________<br>
                          &gt;&gt; &gt; rules-users mailing list<br>
                          &gt;&gt; &gt; <a moz-do-not-send="true"
                            href="mailto:rules-users@lists.jboss.org"
                            target="_blank">rules-users@lists.jboss.org</a><br>
                          &gt;&gt; &gt; <a moz-do-not-send="true"
                            href="https://lists.jboss.org/mailman/listinfo/rules-users"
                            target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
                          &gt;&gt; &gt;<br>
                          &gt;&gt; &gt;<br>
                          &gt;&gt;<br>
                          &gt;&gt;
                          _______________________________________________<br>
                          &gt;&gt; rules-users mailing list<br>
                          &gt;&gt; <a moz-do-not-send="true"
                            href="mailto:rules-users@lists.jboss.org"
                            target="_blank">rules-users@lists.jboss.org</a><br>
                          &gt;&gt; <a moz-do-not-send="true"
                            href="https://lists.jboss.org/mailman/listinfo/rules-users"
                            target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
                          &gt;<br>
                          &gt;<br>
                          &gt;<br>
                          &gt;
                          _______________________________________________<br>
                          &gt; rules-users mailing list<br>
                          &gt; <a moz-do-not-send="true"
                            href="mailto:rules-users@lists.jboss.org"
                            target="_blank">rules-users@lists.jboss.org</a><br>
                          &gt; <a moz-do-not-send="true"
                            href="https://lists.jboss.org/mailman/listinfo/rules-users"
                            target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
                          &gt;<br>
                          &gt;<br>
                          <br>
_______________________________________________<br>
                          rules-users mailing list<br>
                          <a moz-do-not-send="true"
                            href="mailto:rules-users@lists.jboss.org"
                            target="_blank">rules-users@lists.jboss.org</a><br>
                          <a moz-do-not-send="true"
                            href="https://lists.jboss.org/mailman/listinfo/rules-users"
                            target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
                        </div>
                      </div>
                    </blockquote>
                  </div>
                  <br>
                  <br clear="all">
                  <br>
                </div>
              </div>
              -- <br>
              <div class="im"><br>
              </div>
            </blockquote>
          </div>
        </div>
      </div>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>