Memory leak within FOProcessor class

Hi all,
I'm trying to use the XML Publisher API (5.6.2 and 5.6.3) to generate PDF documents from XSL templates and XML data in a J2EE environment (Jboss 4.0.5) with Struts but a memory leak occurs.
It seems not to be a multithreading issue because the leak is there even if the PDF documents are generated one by one.
I made many tests to isolate the leak and I have simplified my code as much as possible: it seems to happen within the FOProcessor class.
One of the tests generates 4,500 PDF documents (one at a time) from an XML file (3 KB) and an XSL file (74 KB with blanks). Nothing else is done with the Jboss server during this test. The XSL file was created before the test from a RTF file with XML Publisher. The memory leak is around 70 KB for each PDF document (around 300 MB for the whole test).
As you can see below from the heap histogram (taken at end of test after a full garbage collection) it seems that the XSL and XML elements/attributes are not released (and thus never garbage collected).
Did I miss something or is there an actual problem with the XML/XSL parsing within the XML Publisher API?
Thanks for your help.

Object Histogram:
Size    Count     Class description
131376968 2353450 java.lang.Object[]
60389464 937300  char[]
48260304 335141  oracle.xml.parser.v2.XSLResultElement
35690000 2230625 oracle.xml.util.FastVector
24127104 1005296 java.lang.String
16539120 413478  oracle.xml.parser.v2.XSLNode$AttrValueTmpl
14757064 128058  int[]
13348768 417149  java.lang.ref.Finalizer
12701776 102220  * ConstMethodKlass
12544808 23433   byte[]
12204080 108965  oracle.xml.parser.v2.XSLText
8344600 86584   java.util.Hashtable$Entry[]
7363768 102220  * MethodKlass
5592784 138700  * SymbolKlass
5362256 335141  oracle.xml.parser.v2.XSLAttributeSet[]
5267336 8135    * ConstantPoolKlass
5234016 163563  java.util.TreeMap$Entry
5121744 213406  java.util.Hashtable$Entry
4900480 61256   oracle.xml.parser.v2.XPathStep
4087120 51089   java.lang.reflect.Method
3823216 40276   java.util.HashMap$Entry[]
3524696 8135    * InstanceKlassKlass
3378000 84450   java.util.Hashtable
3064872 127703  java.util.HashMap$Entry
2971904 6880    * ConstantPoolCacheKlass
2968560 26505   oracle.xml.parser.v2.XSLValueOf
2770656 24738   oracle.xml.parser.v2.XSLVariable
2167520 27094   oracle.xml.parser.v2.XPathFunctionCall
1880088 33573   oracle.xml.parser.v2.PathExpr
1726360 61482   java.lang.String[]
1573720 39343   java.util.HashMap
1476576 30762   oracle.xml.parser.v2.XSLExprValue
1460840 36521   java.util.TreeMap
1319360 23560   oracle.xml.parser.v2.XPathConstantExpr
1054976 16484   org.jboss.mx.server.InvocationContext
1001264 3546    * MethodDataKlass
887424  11049   short[]
835680  8705    java.lang.Class
830208  25944   oracle.xml.util.NSNameImpl
705816  29409   java.util.ArrayList
684152  4501    org.jboss.web.tomcat.tc5.session.SessionBasedClusteredSession
670288  14071   java.lang.Object[]
640832  10013   oracle.xml.parser.v2.XPathVarReference
561056  35066   javax.management.modelmbean.DescriptorSupport
556272  23178   EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap$Entry
552984  30451   java.lang.Class[]
494760  2945    oracle.xml.parser.v2.XSLTemplate
480792  20033   antlr.ANTLRHashString
442576  27661   java.lang.Integer
432096  4501    org.jboss.web.tomcat.statistics.ReplicationStatistics$TimeStatistic
429040  10726   org.hibernate.hql.ast.tree.Node
369880  9247    javax.management.modelmbean.ModelMBeanOperationInfo
312384  19524   java.util.TreeMap$3
305368  5453    java.net.URL
287392  8981    org.jboss.mx.interceptor.ReflectedDispatcher
259264  338     EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap$Entry[]
252280  4505    org.jboss.cache.lock.ReadWriteLockWithUpgrade
238600  5965    org.jboss.mx.interceptor.PersistenceInterceptor
238600  5965    org.jboss.mx.interceptor.AttributeDispatcher
236616  9859    org.jboss.mx.server.AbstractMBeanInvoker$OperationKey
219776  3434    java.lang.reflect.Constructor
206880  6465    javax.management.modelmbean.ModelMBeanAttributeInfo
193168  2259    java.lang.reflect.Method[]
173184  5412    java.lang.ref.SoftReference
164920  589     oracle.xml.parser.v2.XSLStylesheet
164464  541     * ObjArrayKlassKlass
152832  6368    org.dom4j.tree.DefaultAttribute
149472  2076    java.lang.reflect.Field
144160  4505    org.jboss.cache.Node
143160  5965    org.jboss.mx.interceptor.ModelMBeanAttributeInterceptor
140600  3515    org.apache.xerces.dom.DeferredTextImpl
140224  2740    javax.management.modelmbean.ModelMBeanAttributeInfo[]
139056  7658    boolean[]
134664  3359    java.lang.String[][]
131936  1178    oracle.xml.parser.v2.XSLCondition
131936  1178    oracle.xml.parser.v2.XSLForEach
129072  2668    javax.management.modelmbean.ModelMBeanOperationInfo[]
128952  5373    EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap$Entry
124776  1733    org.hibernate.hql.ast.tree.IdentNode
115200  1800    javax.management.modelmbean.ModelMBeanInfoSupport
113088  2356    oracle.xml.parser.v2.AdditiveExpr
109416  4559    java.beans.PropertyChangeSupport
108960  1135    java.io.ObjectStreamClass
108120  4505    org.jboss.cache.lock.IdentityLock
105864  345     long[]
98752   3086    java.io.ObjectStreamClass$WeakClassKey
97968   4082    java.util.Vector
96672   2014    java.util.Properties
94240   589     oracle.xml.parser.v2.XSLOutput
90072   3753    javax.management.ObjectName$Property
87432   3643    javax.management.MBeanParameterInfo
82368   858     org.hibernate.hql.ast.tree.DotNode
81248   5078    java.lang.Long
78656   1229    org.hibernate.mapping.Column
77664   4854    java.util.Collections$SynchronizedSet
77448   3227    java.util.LinkedList$Entry
73824   769     org.jboss.mx.modelmbean.XMBean
73536   4596    java.util.Hashtable$KeySet
72144   4509    EDU.oswego.cs.dl.util.concurrent.CopyOnWriteArraySet
72144   4509    EDU.oswego.cs.dl.util.concurrent.CopyOnWriteArrayList
72144   4509    org.jboss.cache.Fqn
72080   4505    org.jboss.cache.lock.ReadWriteLockWithUpgrade$WriterLock
72080   4505    org.jboss.cache.lock.LockStrategyRepeatableRead
72080   4505    org.jboss.cache.lock.ReadWriteLockWithUpgrade$ReaderLock
72080   4505    org.jboss.cache.lock.LockMap
72016   4501    org.apache.catalina.session.StandardSessionFacade
71776   4486    java.io.FileDescriptor
70680   589     oracle.xml.parser.v2.XSLCallTemplate
70680   589     oracle.xml.parser.v2.XSLApplyTemplates
70224   154     org.hibernate.persister.entity.SingleTableEntityPersister
68296   2774    javax.management.ObjectName$Property[]
68160   1065    org.apache.xerces.dom.DeferredElementNSImpl
67760   770     org.hibernate.loader.entity.EntityLoader
66992   19      EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap$Entry[]
65968   1178    oracle.xml.parser.v2.XPathFilterExpr
65968   589     oracle.xml.parser.v2.XMLUTF8Reader
64432   4027    java.util.HashSet
63648   1326    oracle.xml.parser.v2.XMLNode[]
63440   1586    org.hibernate.loader.DefaultEntityAliases
61256   589     oracle.xml.parser.v2.XSLNode
61256   589     oracle.xml.parser.v2.XMLReader
60816   2534    org.apache.xerces.xni.QName
57360   478     org.hibernate.hql.ast.tree.FromElement
56976   1187    org.hibernate.mapping.Property
56544   1178    oracle.xml.parser.v2.XSLNodeSetExpr
56544   1178    oracle.xml.parser.v2.MultiplicativeExpr
56544   1178    oracle.xml.parser.v2.EqualExpr
54384   618     oracle.xml.parser.v2.XMLError
49392   2783    javax.management.MBeanParameterInfo[]
47648   1489    java.util.LinkedHashMap$Entry
47120   589     oracle.xml.parser.v2.XMLByteReader[]
...

Similar Messages

  • Memory leak in string class

    We have developed our application in Solaris 10 environment. While running Purify on that it shows leak in the string class. This leak is incremental and so process size keeps in increasing. If we replace string with char array, the leaks disappears and process size also becomes stable.
    Following is the snapshot of the memory leak stack reported by Purify:
    MLK: 4505 bytes leaked in 85 blocks
    * This memory was allocated from:
    malloc [rtlib.o]
    operator new(unsigned) [libCrun.so.1]
    void*operator new(unsigned) [rtlib.o]
    __rwstd::__string_ref<char,std::char_traits<char>,std::allocator<char> >*std::basic_string<char,std::char_traits<char>,std::allocator<char> >::__getRep(unsigned,unsigned) [libCstd.so.1]
    char*std::basic_string<char,std::char_traits<char>,std::allocator<char> >::replace(unsigned,unsigned,const char*,unsigned,unsigned,unsigned) [libCstd.so.1]
    std::basic_string<char,std::char_traits<char>,std::allocator<char> >&std::basic_string<char,std::char_traits<char>,std::allocator<char> >::operator=(const char*) [libCstd.so.1]
    Has anyone faced this problem earlier or is there any patch available for this?

    Over time, we have found and fixed memory leaks in the C++ runtime libraries.
    Get the latest patches for the compiler you are using. (You didn't say which one.) You can find all patches here:
    [http://developers.sun.com/sunstudio/downloads/patches/index.jsp]
    Also get the latest Solaris patch for the C++ runtime libraries, listed on the same web page.
    If that doesn't fix the problem, please file a bug report at
    [http://bugs.sun.com]
    with a test case that can be compiled and run to demonstrate the problem.

  • Possible memory leak in TagFileTagInfo class

    Hello,
    Our application is experiencing a memory leak in Weblogic, which is not happening in other application servers.
    We are running Weblogic server 10.3 using the distributed jsf 1.2
    Eclipse Memory Analyzer clearly points to TagFileTagInfo class as retaining a Map which holds all the memory. Furthermore, it shows that said map (called _tagFileInfoMap) is holding FileTagFileInfo class instances.
    It could be possible that our application were doing something wrong, and that would cause the described behavior, however I doubt that as the other application servers where our application is deployed do not present this problem.
    Any suggestion on how we should proceed to fix this problem?
    Thanks
    Juan

    Hi,
    Was this issue resolved by using wlappc?
    Were you able to compile the tag files with wlappc? I tried compiling the jsps using wlappc, but it seems that the tool expects an ejb-jar file.
    Any help on this is greatly appreciated.
    Thanks
    Hareesh

  • Memory leak within Media / MediaPlayer / MediaView

    Hi,
    I have a very simple program that plays 3 video one after another in a loop on Windows 7.
    With visualvm I do not see the heap increasing, but with the Windows Task Manager the memory usage is growing rapidly. After an amount of hours the movieplayer stops playing movies.
    I do not see anywhere where I can clean up.
    Can anybody help me please?
    The code is:
    Media media = null;
    MediaPlayer mediaPlayer = null;
    MediaView mediaView1 = new MediaView();
    private final MediaHandler mh;
    static public Group root;
    @Override
    public void start(Stage stage)
    root = new Group();
    stage.setTitle("JavaFX test");
    stage.setResizable(true);
    stage.setFullScreen(true);
    Scene scene = new Scene(root);
    scene.setFill(Color.WHITE);
    stage.setScene(scene);
    stage.show();
    mh = new MediaHandler();
    mh.start();
    public class MediaHandler extends Thread
    public MediaHandler()
    mediaView1.setX(0);
    mediaView1.setY(0);
    root.getChildren().add(mediaView1);
    @Override
    public void run()
    synchronized (root)
    do
    createMediaplayer();
    try
    root.wait();
    catch (InterruptedException e)
    while (true);
    * @param mediaPlayer
    private void createMediaplayer()
    mediaView1.setVisible(true);
    if (media == null || media.getSource().equals(url1))
    media = new Media(url2);
    mediaPlayer = new MediaPlayer(media);
    mediaPlayer.setCycleCount(1);
    mediaPlayer.setAutoPlay(false);
    mediaView1.setMediaPlayer(mediaPlayer);
    mediaPlayer.play();
    else if (media.getSource().equals(url2))
    media = new Media(url3);
    mediaPlayer = new MediaPlayer(media);
    mediaPlayer.setCycleCount(1);
    mediaPlayer.setAutoPlay(false);
    mediaView1.setMediaPlayer(mediaPlayer);
    mediaPlayer.play();
    else
    media = new Media(url1);
    mediaPlayer = new MediaPlayer(media);
    mediaPlayer.setCycleCount(1);
    mediaPlayer.setAutoPlay(false);
    mediaView1.setMediaPlayer(mediaPlayer);
    mediaPlayer.play();
    mediaPlayer.setOnEndOfMedia(new Runnable()
    @Override
    public void run()
    synchronized (root)
    root.notifyAll();
    public static void main(String[] args)
    launch(args);
    Edited by: 975090 on 5-dec-2012 2:56

    I found two issue in javaFx Jira:
    http://javafx-jira.kenai.com/browse/RT-17879 Resolution: Unresolved Created: Nov, 9 2011 12:59 PM
    http://javafx-jira.kenai.com/browse/RT-21050 Resolution: Unresolved Created: Apr, 20 2012 07:48 AM
    Edited by: quitusl on 08/01/2013 18:34
    Edited by: quitusl on 08/01/2013 18:35

  • JRC and JSP memory leak...

    Hi, I have an web application with Crystal Reports integrated via the JRC. However, I have a memory leak within the application. I have narrowed it down to the JSP which uses JRC code. The NetBeans profiler shows a memory leak, it appears to be a leak with the JRC code with the class (com.crystaldecisions.reports.exporters.format.page.pdf.pdflif.f). I have try changing the <timeout> tag in CRConfig and using .dispose() and .close(), all to no avail. This error may jepordize our latest production release... Please, help...

    Best to download 2.0 and install all patches and test again. If not resolved then post your issue with details and code samples.

  • APEX 4.1.1 Memory Leak in IE7

    Hi,
    We busy upgrading our apex and db from 3.0/10G to 4.1.1/11.2G and notice that there appears to be a memory leak when using APEX. At one stage we have had IE7 using over a gig of memory.
    When you load or refresh your page IE7 seems to grab on average 2-5MB of memory for each page load. At first we thought it may have been our apps or setup but this also happens when we go to app 4550 page 1 on apex.oracle.com.
    How to replicate:
    Open task manager to view the Memory Usage.
    Using IE7
    1. Go to http://apex.oracle.com/pls/apex/f?p=4550:1
    2. Go back to Task Manager and note the readings once the CPU Usage for iexplore.exe has stablised to 0.
    3. go back to IE7 and press F5
    4. Repeat steps 2-3 and you will see the Memory usage increases.
    We think this maybe due to a few jQuery UI memory leaks within IE7 and thought this bug ticket maybe of interest http://bugs.jqueryui.com/ticket/7666 (Slightly different versions but similiar experiences)
    Could someone else confirm that they also experience the increasing or have had similiar problems and managed to resolve it?
    TBH, it wouldn't be an issue to use another browser like Firefox to access the builder but this also affects the applications if they include APEX standard Javascript and CSS.
    Thanking you in advance.
    Alistair
    Edited by: Alistair Laing on Jun 16, 2012 2:32 PM
    Added Tags

    Alistair Laing wrote:
    Hi,
    We busy upgrading our apex and db from 3.0/10G to 4.1.1/11.2G and notice that there appears to be a memory leak when using APEX. At one stage we have had IE7 using over a gig of memory.
    When you load or refresh your page IE7 seems to grab on average 2-5MB of memory for each page load. At first we thought it may have been our apps or setup but this also happens when we go to app 4550 page 1 on apex.oracle.com.
    How to replicate:
    Open task manager to view the Memory Usage.
    Using IE7
    1. Go to http://apex.oracle.com/pls/apex/f?p=4550:1
    2. Go back to Task Manager and note the readings once the CPU Usage for iexplore.exe has stablised to 0.
    3. go back to IE7 and press F5
    4. Repeat steps 2-3 and you will see the Memory usage increases.
    We think this maybe due to a few jQuery UI memory leaks within IE7 and thought this bug ticket maybe of interest http://bugs.jqueryui.com/ticket/7666 (Slightly different versions but similiar experiences)
    Could someone else confirm that they also experience the increasing or have had similiar problems and managed to resolve it?Anecdotally, yes. Don't have exact steps for replication or precise numbers, but I have noticed this in passing. On the junk that my client considers a PC suitable for web development the typical IE7 memory footprint with the APEX 3.0 builder and several other tabs running is about 52MB. Add APEX 4.1.1 and it climbs constantly until I have to pull the plug when it gets north of 150MB as the PC can't take it.
    As well that I also have Firefox and 4.1.1 is still experimental at that site...
    At the moment I don't have to resolve it and if I did the only option I'd propose is the replacement of IE7.
    VC wrote:
    Look at this http://www.bbc.co.uk/news/technology-18440979
    Alistair Laing wrote:lol @ VC - I dont shop online at work :-D
    I saw that eariler this week. I do agree with the concept though.So take appropriate action: charge extra for IE7 support.
    The amount of work and effort involved in making our website look normal on IE7 equalled the combined time of designing for Chrome, Safari and Firefox.Is entirely accurate. If it's stated as a requirement, itemise it as an extra on the quote.
    Educate management and bean counters: show them the one line of standards-compliant CSS that's all that is necessary in Safari, Chrome, Firefox and Opera (and just possibly in IE8/9/10), how it isn't supported in IE7, and the tortuous hacks and workarounds that are required to get something equivalent working there.

  • Memory leak and char[] ?

    Hello all,
    I'm not sure whether this post should be here or in WebLogic section, so correct me if I'm wrong.
    I'm working on JDeveloper 11.1.1.3 while deployments are made on standalone WebLogic 10.3.3. This thing occurred in previous versions also.
    With every deployment WebLogic increases it's used memory until the famous PermGen space error, which is after about 5-6 deployments.
    I'm doing my best to understand how to use memleak detection tools. I've switched JDev and WL from Sun jdk which was used before to JRockit, same thing happens. Both JDev's memory profiler and JRockit mission control show something that I really do not understand. char[] uses around 30% of heap space and keeps growing with deployments, next is String with 8%. I never use char in app.
    Am I looking at the wrong thing? Is it normal for char[] to increase on WebLogic on deployments? Does anyone know how to check other things and what to check? Someone on other forums mentioned it would be useful to check if ApplicationContext keeps initializing over again on deployments. Does anyone know how to check this?
    One more thing, I have successfully deployed app on Tomcat, and Tomcat said there is a memory leak in app, but could not tell anything specific.
    I'm kinda lost in this :(

    It is normal for the PermGen space of the Sun's JVM to get filled after several re-deployments. PermGen stands for "permanent generational". This space is used by classes that is unlikely to need to be garbage-collected, so they are placed in this memory space that is never garbage-collected (for example, the Class instances). When you redeploy an application, a new class loader instance is used and it instantiates new Class instances that fill up the PermGen space. But why this happens on JRockit either, I could not explain.
    We have experienced memory leaks related to classes and components that use native memory. For example, we have had significant memory leak when using Oracle's JDBC OCI driver. We were not able to solve this problem, so we switched to JDBC Thin driver (which is very performant and stable today comparing to some years ago). If you are using Oracle JRockit, you can monitor the overall memory usage by the following JRockit command executed at OS command line:
    jrcmd <jrockit_pid> print_memusage>where <jrockit_pid> should be replaced by the JVM process ID.
    If you suspect existence of native memory leaks, then have a look at the article Thanks for the memory for explanations about how Java uses native memory.
    Dimitar

  • Memory Leak with cloneModelFromCastMember()?

    Hello Experts!
    I have been experiencing an apparent memory leak within
    Director 11 when
    using cloneModelFromCastMember().
    I was making the assumption that calling resetWorld() on a
    w3D member
    onBeginSprite() would garbage collect any models previously
    cloned into that
    when I previously ran the movie.
    However, if I repeatedly start and stop the movie Director
    Gobbles roughly
    10Mb more memory each time. The memory usage does not reduce
    upon calling
    resetWorld()
    A good way to replicate this is to use
    cloneModelFromCastMember() on a
    largeish model in a repeat with i = 1 to 50 loop on the on
    beginSprite
    handler.
    Start and stop the movie over and over to see Director's
    memory usage hike
    up.
    Anybody have any advice why this is happening? Do I need to
    explicitly
    delete all models cloned into a member on stopMovie????
    Cheers
    Richard Smith

    Hi Zzzorro,
    Thanks for the advice!
    Why does cloning from external w3D members help? Does it
    avoid the memory
    leak? It never used to happen on Director 8.5 so it has to be
    a new Version
    10 / 11 bug right?
    I need to import several weightmapped boned characters into a
    3D member, and
    due to export issues each character has to have it's own w3D
    file.
    So I have to perform cloning at runtime to build the world. I
    also need to
    clone these characters based on the level, so I can't use
    just one single 3D
    member for both these reasons.
    Thanks for any further ideas.
    Richard Smith
    "zzzorro" <[email protected]> wrote in
    message
    news:gd4sn2$2l8$[email protected]..
    > as a rule of thumb:
    > whenever possible avoid cloneModelFromCastMember in the
    first place.
    > It is highly unrecommended and the intel engineers
    always recommended to
    > use
    > loadFile() with an external w3d file, which is much
    better than having the
    > w3d
    > file in the castlib and using cmfcm.
    > each cmfm rebuilds the whole scene and takes a lot of
    time the bigger the
    > scene is.
    > apart from glitches like leaks, which you found right
    now and other
    > things.
    >
    > I work very much with sw3d and I barely have more than
    one shockwave3d
    > member
    > in any of my movies. in very rare cases I use 2 sw3d
    members. Other than
    > that I
    > use one member where I build and load everything into
    from external w3d
    > files
    > with loadFile(), which is much more appropriate. the
    only downside is that
    > I
    > can't change the model name, but there are ways to deal
    with it.
    >

  • Memory Leak with GotoAndStop()

    I am trying to track down a solution to a memory leak within an embedded video.  If I embed a video on the timeline and then run gotoAndStop or gotoAndPlay to a specific frame every time the frame changes it takes in more memory until it crashes at about 1.7GB however if I run a straight play() on the same clip the memory usage remains constant.  I have also tried System.gc() as it is an AIR App and have tried unloadAndStop() with the embeded video being loaded into a Loader and neither can reclaim any memory.
    I am looking for a a way to resolve the memory leak or another way to be able to rapidly jump to specific frames of video as far as I know this is not possible with external flvs.
    Thanks
    Dave

    video is much like a .gif file.  if you start at frame 0 and jump to frame 30 it needs to redraw what it does nt have in frame 30  which means tellign it to start at frame 30 is the same as telling it to get all information from when it last changed which might be frame 27 to complete the frame of what should display on frame 30.
    this is why its slow to play backwards.  and best to play an flv forward.
    what i would suggest if you do not need video persay, would be to use png sequences.  but if your videos are long then i suppose it would be a greater advantage to keep it compressed.
    what is the quality as well of the video and its size and your frame rate?
    You mention that you are creating a 3d view, how is that?  do you use more than 1 swf ?
    I still think this does not sound like a play head issue, since the video is already compiled.

  • Memory Leak with the new PatchMix App Beta?

    E6300/ASUS P5B-D/2GB RAM/EMU 0404/Vista Ultimate 32bit
    The problem happens after I upgrade to the PatchMix driver set dated 9/11.
    The physical memory usage bumps from ~24M to 150M after running 24 hours, and I didnt load any FX.
    The commit size(real memory usage) is over 500M!
    This doesnt happen with the old beta driver.
    Anyone has the same problem?

    Emon wrote:
    jreid wrote:
    Dare I suggest the problem might be Vista?
    Yes? How exactly would Vista cause a memory leak within PatchMix DSP's GUI?
    Well, just a thought. The OS is ultimately responsible for all memory management, and also the low-level graphics functions that would be called by e.g. the GUI code. I just noticed that people on XP didn't seem to be having the same problems with this beta.

  • Memory leak in String(byte[] bytes, int offset, int length)

    Has anyone run into memory leak problem using this String(byte[] bytes, int offset, int length) class? I am using it to convert byte array to string, and I am showing memory leak using this class. Any idea what is going on?

    Hi,
    If you post in Native methods forum I assume you are using this constructor in the native side.
    Be aware that getting char * from jstring eats memory that you must free before returning from native with env->ReleaseStringUTFChars().
    --Marc (http://jnative.sf.net)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Memory Leak - again...

    Hello,
    Given the code snipppet below, will it generate a memory leak?.
    public class Dummy {
         public static List getList( String key){
                    List dList;
              dList = getAllDummyLists( key );
                    return dList;
                    //when this method exits, will dList be freed by GC?
    }Thank you!

    It depends on what getAllDummyLists does.
    It's difficult to find memory leaks by visual inspection. If it were easy, it wouldn't be a problem.
    If this is for work, the correct thing for you to do is to use a profiler.
    Edited by: paulcw on Nov 14, 2007 7:54 PM

  • Memory leaks with Third party classes

    Hello all,
    This is fairly known problem. But I guess, my problem gives a new dimention to the problem.
    I have an application which is developed by me. This application ideally needed to use third party classes ( obviously no source code is supplied ). These third party classes provide extra functionality required.
    The problem is, when I don't use third party classes in my application, every thing is fine. When I include third party classes, I am having memory leaks.
    Then I tried to investigate memory leaks with Optimizeit tool. It is new to me. As of now, I understood, we can identify where the memory leaks are occuring.
    finally the problem is, in order to solve this, I need some patches in the code. But I don't have source code for those classes. How to solve this problem?
    For example,
    I use a third party classes in my code like this,
    ThirdPartyMemoryLeakClass obj = new ThirdPartyMemoryLeakClass();
    This 'obj' is made static, as it takes lot of time to create this object. Obviously this object contains several references to other objects, which I can't control.
    In the process of reusing this object, I am getting memory leaks.
    Any ideas regarding, how one has to deal this type of situations? What are the issues involved with this case? Are there any similar problems, which have been solved? are most welcome.
    many thanks for your time.
    Madhav

    Decompile it using jad. Find leak.Yes, I too got the idea and tried to decompile those classes and recompile. I had some problems while recompiling. Is this is the only way to get rid of this problem?
    I was refering to powersoft.datawindow.DataStore class. Does any body here has worked on these?
    Can you suggest me how to find the memory leak causes? if you were needed to find out memory leak causes, what would be your approach?
    Madhav

  • HTTPService + XML Load + Memory Leak

    Hi all....
    I have noticed a memory leak in my application. This leak was
    not apparent when the application was completed some months back
    which is what left me a little confused as all I have done since
    was upgrade to Flex 3 and possibly updated / changed my Flash
    player.
    I think I have found the cause to this problem (below) but am
    not 100% sure that it is the "actual" problem or any reasons to
    back my thoughts up, so have listed what I have checked / tried
    along the way (maybe I have missed something)....
    My Discovery Process:
    I started profiling my application but did not find anything
    out of the ordinary. I did a code walk-through double checking I
    had cleaned up after myself, removing and even nulling all items
    etc but still to now success - the leak is still there.
    I have profiled the app in the profiler for reasonably long
    periods of time.
    All the classes etc being used within the app are consistent
    in size and instance amount and there is no sign of any apparent
    leak.
    I am using a HTTPService that is loading XML data which I am
    refreshing every 5 seconds. On this 5 second data refresh some
    class instances are incremented but are restored to the expected
    amount after a GC has occurred. The GC seems to take longer, the
    longer the app is running, therefore more and more instances are
    being added to the app, but when the GC eventually runs it "seems"
    to clear these instances to the expected amount.
    After scratching my head for a while I decided to make a copy
    of my application, rip everything out, and focus in my data load,
    where I found a problem!
    I have now just a HTTPService that loads an XML file every 5
    seconds, and this is all I currently have in the app (as I ripped
    the rest of the code out), e.g:
    Code:
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    ....... creationComplete="initApp()" >
    <mx:HTTPService
    id="httpServiceResults"
    url="
    http://myIP:myPort/myRoot/myXML.cfm"
    resultFormat="e4x"
    result="httpResultHandler(event)" />
    <script....... >
    private var timerPulse:Timer;
    private function initApp():void
    httpServiceResults.send();
    timerPulse = new Timer(5000, 0);
    private function httpResultHandler(event:ResultEvent):void
    timerPulse.start();
    timerPulse.addEventListener(TimerEvent.TIMER, timerRefresh);
    public function timerRefresh(eventObj:TimerEvent):void
    timerPulse.stop();
    timerPulse.removeEventListener(TimerEvent.TIMER,
    timerRefresh);
    timerPulse.reset();
    httpServiceResults.send();
    </script>
    </mx:Application>
    This is pretty much the code I am currently using and it
    leaks.
    I ran and monitored this in both the profiler and the
    activity / task manager, and after running the app for 1800 seconds
    (30 min) in the profiler, the memory size grew from 50mg to 165mg
    just sending the HTTPService.
    I tried loading the service in multiple ways including in AS
    rather than MXML creating new instances of it each time, resetting
    it, nulling it etc... but nothing prevented this memory increase.
    I then tried to load the XML using different methods such as
    using the URLRequest and URLLoader which again caused a memory
    leak.
    What still confuses me is that this leak did not exist in the
    previous version and not a great deal has changed since then apart
    from upgrading to Flex 3 and possibly upgrading my Flash payer
    (which I believe is a possible cause)
    After looking into this issue a bit more deeply, I read a few
    blogs / forums and other people are experiencing the same problems
    - even with a lot bigger leaks in some cases all when reloading
    large sets of XML data into Flex - however, I as of yet found no
    solution to this leak - people with a similar problem believe it is
    not due to a memory leak more a GC error, and others pointing
    towards the Flash Player itself that is leaking - I don't really
    know.
    Findings so far during investigation of this issue:
    * App leaks for both HTTPService and ULRRequest / URLLoader
    methods
    * App only leaks when calling a data loader
    * The size of the leak seems to depend on the size of the
    XML being loaded
    * The size of the leak also seems to be affected by the
    applications heaviness - the greater seems to enhance the leak
    An interesting factor I have noticed is that if I copy the
    XML from my "myXML.cfm" that I link to in my HTTPService and copy
    the contents of the file into my own XML file stored within the
    Flex project root itself: ""myXML.xml"" the leak disappears... like
    it seems to link when loading the XML over a network, however as my
    network knowledge is not great I am not sure what to make of this -
    any ideas???
    Could the connection to the XML document cause leaks??? is
    there anything else that could cause this leak??? have I something
    in my code sample that could cause this leak??? or could any of the
    other things I have mentioed cause this leak???
    Any help / ideas would be greatly appreciated.
    Thanks,
    Jon.

    I also observed heavy memory leak from using httpservice with
    XML data. I am using Flex3 builder under Linux. My Flex application
    polls httpservice every 10 seconds. The reply is a short XML
    message less than 100 bytes. This simple polling will consume 30+
    MB of memory every hour. I leave it idling for several hours and it
    took 200 MB of memory. No sign of garbage collection at all.

  • Memory leak on SunOne Web Server 6.1 on application reload

    Hi!
    I am pretty sure that i have found a memory management problem in
    SunOne Web Server 6.1 .
    It started with an OutOfMemory error we got under heavy load . After
    some profiling with Jprofiler i didn't find any memory leaks in the
    application.Even under heavy load (generated by myself) i can't find
    anything ,more, i can't reproduce the error! The memory usage is
    about 20Mb and does not go up .
    However it is pretty simple to see the following behavior:
    [1] Restart the server (to have a clear picture) and wait a little for
    memory usage to stabilize.
    [2] In the application dir. touch .reload or one of the classes:
    The memory usage goes up by another 50Mb (huge amount of mem. taking
    into account the fact that it used only 20Mb under any load befor).
    Do this another time and another 20Mb gone etc..
    The JProfiler marks the memory used by classes . And it can be
    clearly seen the GC can't release most of it.
    I AM sure this is not the application that takes all the memory.
    Another hint : after making the server to reload application i can see
    that the number of threads ON EVERY RELOAD is going up by ~10-20
    threads .The # of threads goes lower over time but not the mem usage.
    My system:
    Sparc Solaris 9 ,Java 1.4.2_04-b05, Sun ONE Web Server 6.1SP5
    Evgeny

    my guess is that - because of '.reload' , web container tries to
    recompile all the classes that you use within your web application and
    hence the memory growth is spiking up.What do you mean by "tries to recompile"?The classes in
    Web-inf are already compiled! And i have only ~5 jsp's .
    (the most part of the applic. is a complicated business logic)
    If you are talking about reloading them ,yes,that's the purpose of .reload,
    isn't it? :).But it seems that container uses the memory for it's own
    classes: the usage of memory for my classes don't really grow
    that much (if at all) after reload (according to profiler)
    Also the real problem is that the memory usage grows to much for
    too long (neither seen it going down) and thus ends with OutOfMemory.
    if you are seeing the memory growth to be flat in stress environment,
    then I am not sure that why do you think that there is a memory leak ?There is no memory leak in stress environment.
    There is memory leak while reloading the application.
    It is a memory hog for sure (~20-30Mb for every reload).
    Memory leak?It seems that way because i can't see memory usage go
    down and after a lot of reloads OutOfMemory is thrown.
    also, what is jvm heap that you use ? did you try jvm tune options like -
    XX:+AggressiveHeap ?256Mb.I can set it bigger ,but how do i know that it will not just delay
    the problem ?
    Thanks for response.
    Evgeny

Maybe you are looking for

  • I am getting a bonjour64 error when trying to update itunes

    I am getting an error message about Bonjour64 when I am trying to updated itunes on pc.

  • Decimal delimiter and excel report generation

    Hello, I've a problem with the "Report Generation Toolkit" while trying to generate reports in MS Excel. I first select data from an Access database table. Although the database table contains information in string-format as well as numbers, in the f

  • Library view in iPad

    In Android version i can choose what i want Grid View, Cover View or Both. Will it be available for iPad version? Also where's hotfix for UDID?

  • BDC  For Bank Reconsilation.

    Dear friends,         I want to create BDC for bank reconcillation using Tcodes FF67 and FEBA. So I want to know whether we can create BDC for such a transactional data or there may be any other solution for the same. Beacuse it is very complicated p

  • SAP GUI screens in Web dynpro ABAP

    Is there an easy way to convert SAPU GUI screns like VA01 into webdynpro screens like the old way of doing with ITS? I don't want to use the SAP portal. I just want to use Webdynpro ABAP only.  Please share your thoughts. Thanks