Aspose PDF memory leak issue - pdf

We are using Aspose PDF and are facing the following issues which are sort of show stopper:
Aspose PDF is not releasing memory. we have set object to null but they do not release memory. Result - in my web service after 20-30 calls, server memory is 100% used, and they start creating timeouts.
-- we are trying to resolve with aspose support team - but no concrete reply since last 2 weeks.
When we convert PDF to txt or HTML - this adds lot of special characters which are not recognized by our scripts.
Your help is much appreciated

just stumbled over this post while looking for a solution to a memory leak problem of my own, although this one is found within their Slides library, used for interacting with Powerpoint files. Not sure what language you're using, but this was eventually how we resolved it using .NET.
After little help from the Aspose team, we finally found that the easiest way to handle this was using a seperate AppDomain for the offending code. This has a slight performance impact, but it's only a few seconds at most so we deemed this to be acceptable. This means that after we're done, we can just call AppDomain.Unload(variable) and it will close everything down and purge the memory and this solved all the issues, we saw the memory leaking and then after the unloading occured, we saw everything released. Hope this helps!

Related

Understand Heap-dump and Thread-dump for Large-scale application

I go through some tutorials of Java Profilers (JVisualVM, JProfiler, YourKit) on Youtube as well as Pluralsight. I got a little bit idea regarding how to check heap-dump and how to find the memory leak. But these all tutorials are elementary.
My query is, when I analyse in heap-dump, I saw only 3 types of objects char[], java.lang.String and java.lang.Object[] which covers almost all memory(more than 70% always). But none from my application.
And the same way for thread dump, I saw HTTP-8080 request (the port I am using) and that leads me to Runnable()'s run method or Java Concurrent Package and again not to any specific code to my project.
I also discussed the problem with some of my friends and analyse their application as well (which doesn't face any issues regarding memory leak and performance), but their results are almost the same.
Would you guys help to understand how to analyse heap-dump and thread-dump in JVisualVM for the large scale application? Any video, blog, anything would be helpful.
I am using OpenJDK-11, AWS ECS-Docker and Tomcat as a web-server.
Checkout the Eclipse Memory Analyzer (https://www.eclipse.org/mat/), I used it in the past several times to successfully find memory leaks, but it takes some time to get familiar with it.
Another advise I can give you is to create benchmark tests with Apache JMeter (https://jmeter.apache.org/) or another tool that lets you reproduce the performance/memory issue and identify the execution path that cause you problems.
Be aware AWS doesn't like when someone execute performance/penetration tests against their services (https://aws.amazon.com/aup/)

Managing LOH in vb.net

I have an vb.net application I distribute to my analysts – We assign perhaps 100 200MB images at a time. The app sequentially opens the large jpg image using GDI+ and the image is placed in the LOH. I scan each pixel looking for data. - when done I dispose the image and use GC.collect. But this does not clear the LOH, and as a result the LOH keeps increasing until the app crashes. A work around is to chop the assignment into 25 instance chunks, but this is risky as our analysts often do this late at night – perhaps after a beer or 2.
The C# construct is
GCSettings.LargeObjectHeapCompactionMode = GCLargeObjectHeapCompactionMode.CompactOnce
but there is no GCSettings available in vb.net
My vb.net code is
loadedImage.Dispose()
MasterImage.Dispose()
GC.Collect()
Finalize()
But I cannot find a vb.net method to force the LOH compaction
When done
Can you help?
GCSettings.LargeObjectHeapCompactionMode was added in .NET 4.5.1. It exists in VB.NET as well as C#. You're probably targeting a lower version of the .NET runtime. If you want access to this feature you will need to compile against a framework version of 4.5.1 or higher.
This likely won't solve the underlying problem, however. Your leak may not even be where you think it is. Profiling your application with an allocation profiler is the best way to track down resource leaks. Without a Minimal, Complete, and Verifiable example, it is difficult to guess where your application may be going wrong.

Help diagnosing crash in Cocoa framework - possible memory leak?

I'm currently migrating the Fragaria framework from a GC-only environment to GC being supported. After the work was done (or what I thought had to be done to make it work) I was able to run the examples that come with the framework without any problems and Instruments didn't show any major memory leaks.
I included non-GC Fragaria in my non-GC application and it crashes as soon as I place the cursor on it. To be honest the usage pattern is different from the examples as I'm embedding it in an instance of NSViewController instead of NSDocument.
Can you give me some tips on how to debug this? I'm a bit lost on where to proceed now.
First thing to do is Build and Analyze the code, then fix any problems it finds.
Next, try running with Zombie detection enabled (google NSZombie).
Finally, each crash's stacktrace should give you a pretty good idea where things have gone off the rails.

Out of Memory errors - tool for finding classic ASP memory leaks?

I am getting Out of Memory errors in classic ASP, probably where attempting to access data. For example:
Microsoft VBScript compilation error '800a03e9'
Out of memory
(some file) Line 0
These errors only happen once in a while and they keep happening for a few minutes and then the webserver must be restarting the app pool because all sessions are lost.
What is a good tool for finding/diagnosing memory leaks in a classic ASP application that makes heavy use of ADO for data access and a couple of other off the shelf COM objects.
Presumably any memory leaks would be from the COM object rather than the script, so a general Windows debugger or leak finder might be what I need. Any advice on what would be appropriate?
Or any other thoughts on what might cause these errors?
Unfortunately, tracking down memory leaks is not an easy task :-(
Here's a good summary of things to watch out for here:
http://www.leinadium.com/code/classic-asp-memory-leaks-in-iis/
Be sure to read the link inside that post as well for a list of tools.
Good luck!
Microsoft has a good utility umdh.exe that may be good for finding leaks in this situation. It allows you to take a "snapshot" at one point, exercise the application (e.g., IIS) then take another snapshot and compare the memory usage differences.
if
you try to get one row data with EOF OR BOF
or
the database connection is close or readony you try to wirte!
you should get the ERROR.

Whats the best way of finding ALL your memory when developing on the Compact Framework?

I've used the CF Remote Performance Monitor, however this seems to only track memory initialised in the managed world as opposed to the unmanaged world. Well, I can only presume this as the numbers listed in the profiler are way short of the maximum allowed (32mb on CE 5). Profiling a particular app with the RPM showed me that the total usage of all the caches only manages to get to about 12mb and then slowly shrinks as (I assume) something unmanaged starts to claim more memory.
The memory slider in System also shows that the device is very short on memory. If I kill the process the slider shows all the memory coming back. So it must (?) be this managed process that is swallowing the memory.
Is there any simple(ish?) fashion how one can track unmanaged memory usage in some way that might enable me to match it up with the corresponding P/Invoke calls?
EDIT: To all you re-taggers it isn't .NET, tagging the question like this confuses things. It's .NETCF / Compact Framework. I know they appear to be similar but they're different because .NET rocks whereas CF is basically just a wrapper around NotImplementedException.
Try enabling Interop logging.
Also, if you have access to the code of the native dll you are using, check this out: http://msdn.microsoft.com/en-us/netframework/bb630228.aspx
I've definitely been fighting with unmanaged issues in a C# managed app for a while -- it's not easy.
What I've found to be most helpful is to have a regular output to a text log file. For example you can print the output of GlobalMemoryStatus every couple of minutes along with logging every time you load a new form. From there you can at least see that either memory gradually erodes, or a huge chunks of memory disappeared at specific times of the day.
For us, we found a gradual memory loss all day as long as the device was being used. From there we eventually found that the barcode scanning device was being initialized for no particular reason in our Form base class (I blame the previous developer! :-)
Setting up this logging may be a small hassle, but for us it paid huge dividends in the long run especially with the device in live use we can get real data, instrumentation, stack traces from exceptions, etc.
Ok, I'm using C++ on CE, not C# so this may not be helpful, but...
I use a package called Entrk toolbox which monitors memory and resource usage, leaks, and exceptions under Windows CE. Pretty much like a lightweight CE version of boundschecker. Does the trick most times.