Re: Re[2]: Enterprise business domain using DS - is it good idea?
Hi Alex, may I answer a couple of your questions. 1) it's Apache Aries, not Felix :-) 2) I think Christian Schneider worked on something similar transforming JEE Annotations to a blueprint structure, but I'm not sure how production-ready it is, as I never used it. But I'm sure he'll give some feedback. 3) Haven't seen any yet 4) If you take a look at the samples around Apache Karaf you'll find lots of Blueprint related samples [1] Regarding Blueprint/DS discussion, as usual you'll always find something that fits your needs better. Sometimes DS is just enough sometimes you'll need to extend something and find that blueprint is suited better. Especially the namespace handling in Blueprint brings another positive side-effect, you'll be able to extend the blueprint mechanism with something like a authentication mechanism on method level, with your own Namespace handler an a InstanceListener. Similar to the way the transactions are declared in blueprint beans. regards, Achim 2015-07-20 7:33 GMT+02:00 Alex Sviridov ooo_satu...@mail.ru: Thanks to everybody! All your comments really help very much! I've studied the difference between Blueprint and DS http://iocanel.blogspot.ru/2013/11/thoughts-on-blueprint-and-declarative.html As I understand the main difference is that Blueprint allows to replace bundle with services when the application is running as Blueprint creates dynamic proxies which are injected in consumer and waits until the service is available (or timeout) while DS will just throws exception. As we are developing enterprise application (client-server) then ability to replace the bundle without stopping the application is a good thing. So we want to test and Blueprint and compare it with DS. I have a few questions (I found some information but I'm afraid it is old): 1) Is blueprint part of apache felix or it is part of apache aries? 2) Does blueprint support generating xml files via annotations like DS. If yes, then what maven plugin should we use 3) What is the influence of using proxies for every service on performance in comparison with DS? 4) Could anyone provide a link to example of using blueprint of last version? Воскресенье, 19 июля 2015, 22:35 +02:00 от Jean-Baptiste Onofré j...@nanthrax.net: Hi Neil, I agree about proxies, but on the other hand, it could be an interesting feature as well. I don't launch any troll blueprint vs DS (I don't care ;)), I just wanted to remember some features. We migrated Karaf from blueprint to DS/pure OSGi, and it works fine, so, I second that DS will match Alex's needs. Maybe, for convenience, some namespace and extended annotations for enterprise could be interesting, but definitely, not mandatory. My $0.02 ;) Regards JB On 07/19/2015 09:57 PM, Neil Bartlett wrote: Blueprint’s use of dynamic proxies is indeed a powerful argument against using it! ;-) But this is surely a distraction? As Alex said in his email: “We have tested DS … and they do all we need.” So Alex, what exactly is your concern? If it is scalability then I think Carsten’s answer covers it quite nicely. Is there some specific feature you are looking for? If you’re just looking for assurance that other people are using DS in the way that you intend to use it, then I can give you that assurance. I have used DS, and helped many of my customers and trainees to use DS, in exactly the scenarios you are talking about. That is: implementing the vast bulk of business components in a large enterprise application. Neil On 19 Jul 2015, at 15:05, Jean-Baptiste Onofré j...@nanthrax.net wrote: Don't forget to mention the dynamic proxies, which can be very interesting for enterprise application IMHO. With DS, people has to remember to use the lifecycle/injection, but it requires all services available at component startup. The namespace extension is also a very interesting feature for enterprise. @Alex, I gave a talk about Karaf for the Enterprise, where I addressed all the enterprise specification supported by Karaf. Regards JB On 07/19/2015 02:10 PM, Christian Schneider wrote: I think the question if DS is a good idea is less about the number of OSGi services. I am pretty sure it can handle any reasonable number. I would rather look into the rest of the stack you are planning to use. Think about the things you also need to do: - UI - Persistence - External integration (Rest, SOAP, Messaging) - Security You should setup a small prototype including these aspects and check how well DS fits into these. Probably you will need to choose some additional frameworks and need to find a way to integrate them with DS. In my current tutorial about DS I also compared some technical aspects of blueprint and DS which might also help: http://liquid-reality.de/display/liquid/2015/06/30/Apache+Karaf+Tutorial+part+10+-+Declarative+services Christian Am
Re: Enterprise business domain using DS - is it good idea?
Am 20.07.2015 um 07:33 schrieb Alex Sviridov: I have a few questions (I found some information but I'm afraid it is old): 2) Does blueprint support generating xml files via annotations like DS. If yes, then what maven plugin should we use There is a blueprint-maven-plugin from aries. It supports using JEE annotations for most of the functionality of blueprint. Basically the goal is to provide annotations for blueprint that are as compatible to JEE as possible so people who learned JEE feel at home. http://aries.apache.org/modules/blueprint-maven-plugin.html The example below shows a small application that uses just annotations. In practice you can also add hand written blueprint for things the plugin does not cover (like e.g. CXF integration). http://www.liquid-reality.de/display/liquid/2015/03/05/Apache+Karaf+Tutorial+Part+9+-+Annotation+based+blueprint+and+JPA The plugin works quite well and is already used in production at one of our customers. The scope of the plugin is limited a bit though. For example it already supports simple transaction and jpa injections but it is not yet compatible to Aries JPA 2. I will probably need to introduce some extension support for the plugin so people can extend it to support other blueprint namespaces. So I encourage you to try it out and see if it fits your current needs. As the code of the plugin is quite small you can also just fork it to adapt to your internal needs if something does not work like you want. In that case I would be happy about feedback or even pull requests so I can add such impovements to the aries version. 3) What is the influence of using proxies for every service on performance in comparison with DS? There is not much performance overhead for proxies. As your service calls should not be extremely fine grained anyway I do not think you will notice a problem. The problem with proxies is more in some other regards. For example blueprint blocks a service call if a mandatory service goes away. So if your business code needs to guarantee short response times this may speak against blueprint. Proxies also make debugging harder as you often hit the proxy impl code while stepping thorugh your code. 4) Could anyone provide a link to example of using blueprint of last version? You can have a look at my Karaf Tutorials. They cover many blueprint features as well as some of the integrations to other frameworks blueprint provides. Starting with my newest Tutorial I will also provide more examples of DS. My goal is to look into things like security, REST, SOAP. http://www.liquid-reality.de/display/liquid/Karaf+Tutorials Christian - To unsubscribe, e-mail: users-unsubscr...@felix.apache.org For additional commands, e-mail: users-h...@felix.apache.org
Re: Enterprise business domain using DS - is it good idea?
Good point actually Carstens ! RegardsJB Sent from my Samsung device Original message From: Carsten Ziegeler cziege...@apache.org Date: 20/07/2015 12:39 (GMT+01:00) To: users@felix.apache.org, Alex Sviridov ooo_satu...@mail.ru Subject: Re: Enterprise business domain using DS - is it good idea? And I think another important point is, it's not one *or* the other. You can start with whatever you think is more suitable and if you find out you need features from the other for something, just use it for that. The great thing here is, you're developing services which interact with each other through the service registry. It doesn't matter what you use to implement them. They all work nicely together Of course, usually dev teams try to focus on a single way to do things (which is preferable of course), but you're not bound to this. For example, we are usually developing everything with DS, but in some cases we go directly with the framework API. Carsten Am 20.07.15 um 08:25 schrieb Achim Nierbeck: Hi Alex, may I answer a couple of your questions. 1) it's Apache Aries, not Felix :-) 2) I think Christian Schneider worked on something similar transforming JEE Annotations to a blueprint structure, but I'm not sure how production-ready it is, as I never used it. But I'm sure he'll give some feedback. 3) Haven't seen any yet 4) If you take a look at the samples around Apache Karaf you'll find lots of Blueprint related samples [1] Regarding Blueprint/DS discussion, as usual you'll always find something that fits your needs better. Sometimes DS is just enough sometimes you'll need to extend something and find that blueprint is suited better. Especially the namespace handling in Blueprint brings another positive side-effect, you'll be able to extend the blueprint mechanism with something like a authentication mechanism on method level, with your own Namespace handler an a InstanceListener. Similar to the way the transactions are declared in blueprint beans. regards, Achim -- Carsten Ziegeler Adobe Research Switzerland cziege...@apache.org - To unsubscribe, e-mail: users-unsubscr...@felix.apache.org For additional commands, e-mail: users-h...@felix.apache.org
Re: Enterprise business domain using DS - is it good idea?
And I think another important point is, it's not one *or* the other. You can start with whatever you think is more suitable and if you find out you need features from the other for something, just use it for that. The great thing here is, you're developing services which interact with each other through the service registry. It doesn't matter what you use to implement them. They all work nicely together Of course, usually dev teams try to focus on a single way to do things (which is preferable of course), but you're not bound to this. For example, we are usually developing everything with DS, but in some cases we go directly with the framework API. Carsten Am 20.07.15 um 08:25 schrieb Achim Nierbeck: Hi Alex, may I answer a couple of your questions. 1) it's Apache Aries, not Felix :-) 2) I think Christian Schneider worked on something similar transforming JEE Annotations to a blueprint structure, but I'm not sure how production-ready it is, as I never used it. But I'm sure he'll give some feedback. 3) Haven't seen any yet 4) If you take a look at the samples around Apache Karaf you'll find lots of Blueprint related samples [1] Regarding Blueprint/DS discussion, as usual you'll always find something that fits your needs better. Sometimes DS is just enough sometimes you'll need to extend something and find that blueprint is suited better. Especially the namespace handling in Blueprint brings another positive side-effect, you'll be able to extend the blueprint mechanism with something like a authentication mechanism on method level, with your own Namespace handler an a InstanceListener. Similar to the way the transactions are declared in blueprint beans. regards, Achim -- Carsten Ziegeler Adobe Research Switzerland cziege...@apache.org - To unsubscribe, e-mail: users-unsubscr...@felix.apache.org For additional commands, e-mail: users-h...@felix.apache.org
Re[2]: Enterprise business domain using DS - is it good idea?
Hello, Christian. Thank you very much for detailed answers and great tutorial! I have one question - Does blueprint support scopes - I need new instance of service for every consumer? Понедельник, 20 июля 2015, 9:24 +02:00 от Christian Schneider ch...@die-schneider.net: Am 20.07.2015 um 07:33 schrieb Alex Sviridov: I have a few questions (I found some information but I'm afraid it is old): 2) Does blueprint support generating xml files via annotations like DS. If yes, then what maven plugin should we use There is a blueprint-maven-plugin from aries. It supports using JEE annotations for most of the functionality of blueprint. Basically the goal is to provide annotations for blueprint that are as compatible to JEE as possible so people who learned JEE feel at home. http://aries.apache.org/modules/blueprint-maven-plugin.html The example below shows a small application that uses just annotations. In practice you can also add hand written blueprint for things the plugin does not cover (like e.g. CXF integration). http://www.liquid-reality.de/display/liquid/2015/03/05/Apache+Karaf+Tutorial+Part+9+-+Annotation+based+blueprint+and+JPA The plugin works quite well and is already used in production at one of our customers. The scope of the plugin is limited a bit though. For example it already supports simple transaction and jpa injections but it is not yet compatible to Aries JPA 2. I will probably need to introduce some extension support for the plugin so people can extend it to support other blueprint namespaces. So I encourage you to try it out and see if it fits your current needs. As the code of the plugin is quite small you can also just fork it to adapt to your internal needs if something does not work like you want. In that case I would be happy about feedback or even pull requests so I can add such impovements to the aries version. 3) What is the influence of using proxies for every service on performance in comparison with DS? There is not much performance overhead for proxies. As your service calls should not be extremely fine grained anyway I do not think you will notice a problem. The problem with proxies is more in some other regards. For example blueprint blocks a service call if a mandatory service goes away. So if your business code needs to guarantee short response times this may speak against blueprint. Proxies also make debugging harder as you often hit the proxy impl code while stepping thorugh your code. 4) Could anyone provide a link to example of using blueprint of last version? You can have a look at my Karaf Tutorials. They cover many blueprint features as well as some of the integrations to other frameworks blueprint provides. Starting with my newest Tutorial I will also provide more examples of DS. My goal is to look into things like security, REST, SOAP. http://www.liquid-reality.de/display/liquid/Karaf+Tutorials Christian - To unsubscribe, e-mail: users-unsubscr...@felix.apache.org For additional commands, e-mail: users-h...@felix.apache.org -- Alex Sviridov
Re: Enterprise business domain using DS - is it good idea?
yes. The R6 version of DS does too. (build it yourself from felix scr trunk at this point). My opinion on DS vs blueprint: The proxies are sort of irrelevant. With DS, with a mandatory dynamic reference, your component will be present when at least one instance of the required service is available and not present otherwise. If you change the target of the reference by starting the new service and then stopping the old one, then your component will just switch without any interruption. To me the biggest functional advantage of DS is the really good integration with config admin (even better in R6). This makes the configuration of your service instances orthogonal to their specification. While Aries blueprint does have config admin integration, it’s sort of bolted on and no one has figured out a plausible way to get it into the blueprint spec (possibly due to lack of interest). While when it started I thought blueprint was ideal, as I’ve learned more about OSGI I’ve come to regard blueprint as a transition crutch for those addicted to Spring. However, I have only used OSGI to develop app servers, I’ve never tried to write an enterprise app using OSGI, so there may be different considerations for your use. thanks david jencks On Jul 20, 2015, at 9:17 AM, Alex Sviridov ooo_satu...@mail.ru wrote: Hello, Christian. Thank you very much for detailed answers and great tutorial! I have one question - Does blueprint support scopes - I need new instance of service for every consumer? Понедельник, 20 июля 2015, 9:24 +02:00 от Christian Schneider ch...@die-schneider.net: Am 20.07.2015 um 07:33 schrieb Alex Sviridov: I have a few questions (I found some information but I'm afraid it is old): 2) Does blueprint support generating xml files via annotations like DS. If yes, then what maven plugin should we use There is a blueprint-maven-plugin from aries. It supports using JEE annotations for most of the functionality of blueprint. Basically the goal is to provide annotations for blueprint that are as compatible to JEE as possible so people who learned JEE feel at home. http://aries.apache.org/modules/blueprint-maven-plugin.html The example below shows a small application that uses just annotations. In practice you can also add hand written blueprint for things the plugin does not cover (like e.g. CXF integration). http://www.liquid-reality.de/display/liquid/2015/03/05/Apache+Karaf+Tutorial+Part+9+-+Annotation+based+blueprint+and+JPA The plugin works quite well and is already used in production at one of our customers. The scope of the plugin is limited a bit though. For example it already supports simple transaction and jpa injections but it is not yet compatible to Aries JPA 2. I will probably need to introduce some extension support for the plugin so people can extend it to support other blueprint namespaces. So I encourage you to try it out and see if it fits your current needs. As the code of the plugin is quite small you can also just fork it to adapt to your internal needs if something does not work like you want. In that case I would be happy about feedback or even pull requests so I can add such impovements to the aries version. 3) What is the influence of using proxies for every service on performance in comparison with DS? There is not much performance overhead for proxies. As your service calls should not be extremely fine grained anyway I do not think you will notice a problem. The problem with proxies is more in some other regards. For example blueprint blocks a service call if a mandatory service goes away. So if your business code needs to guarantee short response times this may speak against blueprint. Proxies also make debugging harder as you often hit the proxy impl code while stepping thorugh your code. 4) Could anyone provide a link to example of using blueprint of last version? You can have a look at my Karaf Tutorials. They cover many blueprint features as well as some of the integrations to other frameworks blueprint provides. Starting with my newest Tutorial I will also provide more examples of DS. My goal is to look into things like security, REST, SOAP. http://www.liquid-reality.de/display/liquid/Karaf+Tutorials Christian - To unsubscribe, e-mail: users-unsubscr...@felix.apache.org For additional commands, e-mail: users-h...@felix.apache.org -- Alex Sviridov - To unsubscribe, e-mail: users-unsubscr...@felix.apache.org For additional commands, e-mail: users-h...@felix.apache.org
Re: Enterprise business domain using DS - is it good idea?
I have to agree with David, So, more feedback from someone doing a really huge enterprise product migrating from Java EE to OSGi (4+ years in the making...) Service Damping is hell. You will not enjoy experiencing the complexity that service damping will impose on your already complex environment, particular if your goal has at least some designs on optionality. Since there is no (to my knowledge) alternative for dealing with service references in blueprint other than service damping, this made it so painful for us that after more than a couple years with BP in our lives we recently undertook to remove it all. Had blueprint NOT been implemented with service damping, it could have been tolerable and even likely that we would have used it more. Perhaps if BP-next provides an alternative more akin to DS (passive wait via listeners) we may go back to it in some rare cases. However, even when it comes to things like transactions and security, there are other models that work just as well. Lastly, I think it's just a bad idea to try to shoehorn dynamics into non-dynamic models like spring/CDI because they have fundamentally different expectations. Sincerely, - Ray On Mon, Jul 20, 2015 at 11:41 AM, David Jencks david.a.jen...@gmail.com wrote: yes. The R6 version of DS does too. (build it yourself from felix scr trunk at this point). My opinion on DS vs blueprint: The proxies are sort of irrelevant. With DS, with a mandatory dynamic reference, your component will be present when at least one instance of the required service is available and not present otherwise. If you change the target of the reference by starting the new service and then stopping the old one, then your component will just switch without any interruption. To me the biggest functional advantage of DS is the really good integration with config admin (even better in R6). This makes the configuration of your service instances orthogonal to their specification. While Aries blueprint does have config admin integration, it’s sort of bolted on and no one has figured out a plausible way to get it into the blueprint spec (possibly due to lack of interest). While when it started I thought blueprint was ideal, as I’ve learned more about OSGI I’ve come to regard blueprint as a transition crutch for those addicted to Spring. However, I have only used OSGI to develop app servers, I’ve never tried to write an enterprise app using OSGI, so there may be different considerations for your use. thanks david jencks On Jul 20, 2015, at 9:17 AM, Alex Sviridov ooo_satu...@mail.ru wrote: Hello, Christian. Thank you very much for detailed answers and great tutorial! I have one question - Does blueprint support scopes - I need new instance of service for every consumer? Понедельник, 20 июля 2015, 9:24 +02:00 от Christian Schneider ch...@die-schneider.net: Am 20.07.2015 um 07:33 schrieb Alex Sviridov: I have a few questions (I found some information but I'm afraid it is old): 2) Does blueprint support generating xml files via annotations like DS. If yes, then what maven plugin should we use There is a blueprint-maven-plugin from aries. It supports using JEE annotations for most of the functionality of blueprint. Basically the goal is to provide annotations for blueprint that are as compatible to JEE as possible so people who learned JEE feel at home. http://aries.apache.org/modules/blueprint-maven-plugin.html The example below shows a small application that uses just annotations. In practice you can also add hand written blueprint for things the plugin does not cover (like e.g. CXF integration). http://www.liquid-reality.de/display/liquid/2015/03/05/Apache+Karaf+Tutorial+Part+9+-+Annotation+based+blueprint+and+JPA The plugin works quite well and is already used in production at one of our customers. The scope of the plugin is limited a bit though. For example it already supports simple transaction and jpa injections but it is not yet compatible to Aries JPA 2. I will probably need to introduce some extension support for the plugin so people can extend it to support other blueprint namespaces. So I encourage you to try it out and see if it fits your current needs. As the code of the plugin is quite small you can also just fork it to adapt to your internal needs if something does not work like you want. In that case I would be happy about feedback or even pull requests so I can add such impovements to the aries version. 3) What is the influence of using proxies for every service on performance in comparison with DS? There is not much performance overhead for proxies. As your service calls should not be extremely fine grained anyway I do not think you will notice a problem. The problem with proxies is more in some other regards. For example blueprint blocks a service call if a mandatory service goes away. So if your business code
gogo not showing me all the bundles in OBR
The XML below is two elements from the OBR data returned by my repository. Using the current gogo components, I see the second one (the 'rc1' version) but not the first. (current = shell 0.10.0, command = 0.14.0, runtime = 0.16.2) I did 'repos add (URL_OF_THE_OBR.XML FILE)' resource id='com.basistech.common-api/35.0.0' presentationname='common-api' symbolicname='com.basistech.common-api' uri='../com/basistech/common-api/35.0.0/common-api-35.0.0.jar' version='35.0.0' description Common API classes for Rosette /description documentation http://basistech.com /documentation size 44848 /size capability name='bundle' p n='manifestversion' v='2'/ p n='presentationname' v='common-api'/ p n='symbolicname' v='com.basistech.common-api'/ p n='version' t='version' v='35.0.0'/ /capability capability name='package' p n='package' v='com.basistech.rosette'/ p n='version' t='version' v='35.0.0'/ /capability capability name='package' p n='package' v='com.basistech.rosette.util'/ p n='version' t='version' v='35.0.0'/ /capability capability name='package' p n='package' v='com.basistech.util'/ p n='version' t='version' v='35.0.0'/ /capability /resource resource id='com.basistech.common-api/34.0.0.rc1' presentationname='common-api' symbolicname='com.basistech.common-api' uri='../com/basistech/common-api/34.0.0-rc1/common-api-34.0.0-rc1.jar' version='34.0.0.rc1' description Common API classes for Rosette /description documentation http://basistech.com /documentation size 44897 /size capability name='bundle' p n='manifestversion' v='2'/ p n='presentationname' v='common-api'/ p n='symbolicname' v='com.basistech.common-api'/ p n='version' t='version' v='34.0.0.rc1'/ /capability capability name='package' p n='package' v='com.basistech.rosette'/ p n='version' t='version' v='34.0.0'/ /capability capability name='package' p n='package' v='com.basistech.rosette.util'/ p n='version' t='version' v='34.0.0'/ /capability capability name='package' p n='package' v='com.basistech.util'/ p n='version' t='version' v='34.0.0'/ /capability /resource - To unsubscribe, e-mail: users-unsubscr...@felix.apache.org For additional commands, e-mail: users-h...@felix.apache.org
Re: AEM performance issues (slow memory leak) org.slf4j.helpers.BasicMarker and org.slf4j.helpers.BasicMarkerFactory
Hi Nicola, This issue is most likely not related to Felix, so you'll probably get more help on AEM forums. However, I would make the following points: A CPU spike is not usually a symptom of a memory leak, so the logger issue may be a red herring. I've noticed myself that AEM 5.6.1 may have a memory leak if you redeploy packages many times - usually it is related to the permgen memory (class storage), and happens when a package is replaced but it's classloaders and classes are not garbage collected (due to things like dangling references). But for your issue I would use top to verify the CPU spike is actually caused by AEM, and then probably run a profiler that can monitor threads to see which thread is spiking. Regards, Ben On 21 Jul 2015 8:43 am, Nicola Abello nic...@infielddesign.com wrote: I am currently using the Adobe Experience Manager (AEM also known as CQ) for a Client's site (Java platform). It uses OpenJDK: java version 1.7.0_65 OpenJDK Runtime Environment (rhel-2.5.1.2.el6_5-x86_64 u65-b17) OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode) It is running on Rackspace with the following: vCPU: 4 Memory: 16GB Guest OS: Red Hat Enterprise Linux 6 (64-bit) Since it has been in production I have been experiencing very slow performance on the part of the application. It goes like this I launch the app, everything is smooth then 7 to 10 days later the CPU usage spikes to 400% (~4000 users/day hit the site). The site becomes exceptionally slow and never becomes an OOM exception. Since I am a novice at Java Memory management I started reading about how it works and found tools like jstat and jmap. When the system was overwhelmed the second time around, I got a heap dump and dug into it. It all seems to be pointing out at org.slf4j.helpers.BasicMarkerFactory and org.slf4j.helpers.BasicMarker as when I analyze it with MAT eclipse I see that the biggest retained object by retained size is: org.slf4j.helpers.BasicMarkerFactory @ 0x6021a4f00Shallow Size: 16 B Retained Size: 6.8 GB and When I run a *Leak suspects report* I get the following result: DescriptionOne instance of org.slf4j.helpers.BasicMarkerFactory loaded by org.apache.felix.framework.BundleWiringImpl$BundleClassLoaderJava5 @ 0x60219a878 occupies 7,263,024,848 (96.71%) bytes. The memory is accumulated in one instance of java.util.concurrent.ConcurrentHashMap$Segment[] loaded by system class loader. Keywords java.util.concurrent.ConcurrentHashMap$Segment[] org.apache.felix.framework.BundleWiringImpl$BundleClassLoaderJava5 @ 0x60219a878 org.slf4j.helpers.BasicMarkerFactory and Shortest Paths To the Accumulation Point Class Name Shallow HeapRetained Heap java.util.concurrent.ConcurrentHashMap$Segment[16] @ 0x6021a4f40 80 7,263,024,784 segments java.util.concurrent.ConcurrentHashMap @ 0x6021a4f10 48 7,263,024,832 . ... markerMap org.slf4j.helpers.BasicMarkerFactory @ 0x6021a4f00 16 7,263,024,848 . ... markerFactory org.slf4j.impl.StaticMarkerBinder @ 0x6021d3970 16 16 . ... SINGLETON class org.slf4j.impl.StaticMarkerBinder @ 0x6021d38f8 8 24 . ... [328] java.lang.Object[640] @ 0x6021d2ee8 2,576 9,592 . ... elementData java.util.Vector @ 0x6021d0fe0 32 9,624 . ... classes org.apache.felix.framework.BundleWiringImpl$ BundleClassLoaderJava5 @ 0x6021c32e0 96 26,888 . ... classloader class ch.qos.logback.classic.Logger @ 0x600be4310 16 16 . . . ...class ch.qos.logback.classic.Logger @ 0x600282a78 48 48 . ... Java Local java.lang.Thread @ 0x60077b450 pool-9-thread-1 Thread 104 3,344 . ... class ch.qos.logback.classic.Logger @ 0x60025b850 48 48 . ... class ch.qos.logback.classic.Logger @ 0x604b0a708 48 48 . ... class ch.qos.logback.classic.Logger @ 0x604b0a6d8 48 48 .
AEM performance issues (slow memory leak) org.slf4j.helpers.BasicMarker and org.slf4j.helpers.BasicMarkerFactory
I am currently using the Adobe Experience Manager (AEM also known as CQ) for a Client's site (Java platform). It uses OpenJDK: java version 1.7.0_65 OpenJDK Runtime Environment (rhel-2.5.1.2.el6_5-x86_64 u65-b17) OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode) It is running on Rackspace with the following: vCPU: 4 Memory: 16GB Guest OS: Red Hat Enterprise Linux 6 (64-bit) Since it has been in production I have been experiencing very slow performance on the part of the application. It goes like this I launch the app, everything is smooth then 7 to 10 days later the CPU usage spikes to 400% (~4000 users/day hit the site). The site becomes exceptionally slow and never becomes an OOM exception. Since I am a novice at Java Memory management I started reading about how it works and found tools like jstat and jmap. When the system was overwhelmed the second time around, I got a heap dump and dug into it. It all seems to be pointing out at org.slf4j.helpers.BasicMarkerFactory and org.slf4j.helpers.BasicMarker as when I analyze it with MAT eclipse I see that the biggest retained object by retained size is: org.slf4j.helpers.BasicMarkerFactory @ 0x6021a4f00Shallow Size: 16 B Retained Size: 6.8 GB and When I run a *Leak suspects report* I get the following result: DescriptionOne instance of org.slf4j.helpers.BasicMarkerFactory loaded by org.apache.felix.framework.BundleWiringImpl$BundleClassLoaderJava5 @ 0x60219a878 occupies 7,263,024,848 (96.71%) bytes. The memory is accumulated in one instance of java.util.concurrent.ConcurrentHashMap$Segment[] loaded by system class loader. Keywords java.util.concurrent.ConcurrentHashMap$Segment[] org.apache.felix.framework.BundleWiringImpl$BundleClassLoaderJava5 @ 0x60219a878 org.slf4j.helpers.BasicMarkerFactory and Shortest Paths To the Accumulation Point Class Name Shallow HeapRetained Heap java.util.concurrent.ConcurrentHashMap$Segment[16] @ 0x6021a4f40 80 7,263,024,784 segments java.util.concurrent.ConcurrentHashMap @ 0x6021a4f10 48 7,263,024,832 . ... markerMap org.slf4j.helpers.BasicMarkerFactory @ 0x6021a4f00 16 7,263,024,848 . ... markerFactory org.slf4j.impl.StaticMarkerBinder @ 0x6021d3970 16 16 . ... SINGLETON class org.slf4j.impl.StaticMarkerBinder @ 0x6021d38f8 8 24 . ... [328] java.lang.Object[640] @ 0x6021d2ee8 2,576 9,592 . ... elementData java.util.Vector @ 0x6021d0fe0 32 9,624 . ... classes org.apache.felix.framework.BundleWiringImpl$ BundleClassLoaderJava5 @ 0x6021c32e0 96 26,888 . ... classloader class ch.qos.logback.classic.Logger @ 0x600be4310 16 16 . . . ...class ch.qos.logback.classic.Logger @ 0x600282a78 48 48 . ... Java Local java.lang.Thread @ 0x60077b450 pool-9-thread-1 Thread 104 3,344 . ... class ch.qos.logback.classic.Logger @ 0x60025b850 48 48 . ... class ch.qos.logback.classic.Logger @ 0x604b0a708 48 48 . ... class ch.qos.logback.classic.Logger @ 0x604b0a6d8 48 48 . ... class ch.qos.logback.classic.Logger @ 0x6049debe0 48 48 . ... class ch.qos.logback.classic.Logger @ 0x604535228 48 48 . ... class ch.qos.logback.classic.Logger @ 0x604124248 48 48 Also when I run: $ sudo -u aem jmap -histo PID num #instances #bytes class name-- 1: 11460084 950827248 [C 2: 10740160 257763840 java.lang.String 3: 7681495 245807840 java.util.concurrent.ConcurrentHashMap$HashEntry 4: 7563527 181524648 org.slf4j.helpers.BasicMarker 5:217007 173568376 [I 6:177602 158721184 [B 7: 60611 69739136