AIR runtime Memory Leak?
Hi,
I have an app developed with AIR 3.7 for iOS (iPad)
The app gets very sluggish after a while, eventually crashes.
I've been -very- careful to pool objects where possible and cleanup / nullify all objects once they're not needed any more.
Profiling the app in Scout returns a pretty stable memory profile (the peaks and the lows translate very well to what's happening on screen)
Simultenously profiling the app using XCode's Instruments, shows me that the memory consumption off the app constantly rises up to the point the systems spends more time throwing memory warning than anything else.
Here are screenshots of both profilers: they show as3 memory usage being pretty stable, on the app level, memory keeps rising...
https://dl.dropboxusercontent.com/u/608333/AIR_memory_leak.zip
If AS3 is not leaking any memory (according to scout), but the app is (according to Instruments), would I be right assuming there's a memory leak in the AIR-runtime itself?
thanks for your feedback!
bart.
ok, lots of trial and error has showed me the following:
There are two issues when loading assets using the Loader Class with its LoaderContext set to ImageDecodingPolicy.ON_LOAD.
These issues typically arise in a magazine-like app, where many images are loaded and unloaded continously.
Issue 1:
When initializing a load() on a Loader class with LoaderContext to ImageDecodingPolicy.ON_LOAD, all image decoding seems to be queued in a seperate thread. With several large images, especially on mobile devices, the time to crunch through a queue like this can easily go into dozens of seconds. During that time, some of the loaders can be unloaded, cleared, nulled and deleted. Yet, the loader isn't removed from the decoding queue.
In other words: once you fire the 'load' method on a Loader instance, you're not able to cancel the decompression process, even though the decompression might not even have started yet, as queued by other decompressions.
Issue 2:
When a Loader instance is unloaded, cleared, nulled and deleted while its decompression is still queued and not yet fully decompressed, there seems to be a memory leak. With several dozens of images loading and interupting the loading, you'll notice a difference in memory consumtion when comparing memory output in Scout and in Instruments. Both memory graphs build up very similar yet after the runtime's garbarge collection kicks in, the memory graph in Instruments seems to not release memory fully. Consumption gradually rises until the app eventually crashes.
https://dl.dropboxusercontent.com/u/608333/AIRMemoryLeakExample.zip
This example app allows you to create loaders in bursts by touching the screen.
You'll instantly see the massive waiting times for decompression, despite the fact there's only a few Loader instances in memory at the same time. After several short bursts and wait-a-bit-for-decompression-to-catch-up, you should also notice the difference in memory profiling between Scout and Instruments.
I managed to work around both issues by making a LoaderQueueManager class.
This class instantiates and returns a Loader instance, queues these instances and tracks its onComplete handler. Only when one loader is finished loading, the next loader starts loading. This way, you never have different instances trying to simulataneously decompress their content. As such decompressions are never interrupted and loaders can also be de-queued. This practically speeds up decompression dramatically, since images that are removed won't get decompressed in vain. Memory Leaks also don't occur, since not a single decompression is ever interupted.
This solution only works with content loaded locally.
Hope you can get somewhere with this,
and hopefully, you find a fix in one of the next AIR releases.
best,
bart.
Similar Messages
-
I am developing games on Android devices and I find the total memory usage of my air application presented in Scout is always smaller (100M) than the memory usage shown in the Taskmanager.
Some articles say that the Scout does not count the memory used by the air runtime.
However, it is not possible that the air runtime occupies more than 100M memory, right? Especially, on Android devices?
I have also written a very small test app, it only occupies 20M memory (containing the air runtime).
My question is how can I reduce the additional 100M memory not presented in Scout?I am developing games on Android devices and I find the total memory usage of my air application presented in Scout is always smaller (100M) than the memory usage shown in the Taskmanager.
Some articles say that the Scout does not count the memory used by the air runtime.
However, it is not possible that the air runtime occupies more than 100M memory, right? Especially, on Android devices?
I have also written a very small test app, it only occupies 20M memory (containing the air runtime).
My question is how can I reduce the additional 100M memory not presented in Scout? -
Load / unload numerous images in air application (memory leak?)
Hi,
after struggling for a few days with this, I realized I need help!
I am trying to make an application load and display A LOT (hundreds) of images thumbnails at various position in a big area. The problem is that when I try to unload and reload images, I end up with an increasing memory, that does not get collected by the garbage collector.
My first challenge was to load images from anywhere in the computer (I am quite new to flex), which I solved by using a File reference and a Loader using the url extracted from the file:
private function createImage():void {
var img_:String = "1905_a_mondrian.jpg";
var imageFile:File = new File();
imageFile.nativePath = imagesPath + "/" + img_;
var imageLoader:Loader = new Loader();
// useWeakReference permits the GC to collect the memory when the eventListener is dropped
imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loaded, false, 0, true);
imageLoader.load(new URLRequest(imageFile.url));
imageFile = null;
I make sure I remove the eventListener in the loaded method:
e.target.content.removeEventListener(Event.COMPLETE, loaded);
And then Populate an external component:
<?xml version="1.0" encoding="utf-8"?>
<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/halo"
x="-100" y="-100" width="200" height="200" >
<!-- The trick is right above this line: offset the anchor point to center the component around -->
<fx:Script>
<![CDATA[
import mx.controls.Image;
[Bindable]
public var image:Image;
]]>
</fx:Script>
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<mx:Image id="img_" source="{image}" horizontalCenter="0" verticalCenter="0" autoLoad="true" />
<!-- impair width and height results in problems for centering the ellipse (e.g. for rotation) -->
<s:Ellipse height="4" width="4" horizontalCenter="0" verticalCenter="0" >
<s:fill>
<s:SolidColor color="0x00FF00"/>
</s:fill>
</s:Ellipse>
</s:Group>
I populate a Dictionary to keep a track of all the component created. Finally I nullify all that I can to hint the garbage collector.
Now I have a function to empty the Dictionary (componentBag below) when we want to unload the images:
protected function button1_clickHandler(event:MouseEvent):void
for each ( var g : Group in componentBag )
((ImgPanel)(g.getChildAt(0))).img_.unloadAndStop(false);
((ImgPanel)(g.getChildAt(0))).image = null;
delete componentBag[g.uid];
g.removeElementAt(0);
this.removeElement(g);
g = null;
triggerGC();
PROBLEM: using profiler, the loading/unloading works once or twice and after the memory keeps increasing... And if I launch the application, wait for a while and do a load/unload, the garbage collection only recovers a few megabytes, far from what was allocated for displaying the images.
What am I missing? Is there a problem with loading a lot of images? Has anyone done this?
In attachment is the full test code, the ImgPanel goes inside a 'views' packageThanks to Anton_AL, I finally solved this problem by using an URLLoader AND a plain Loader:
var loader: URLLoader = new URLLoader( );
loader.dataFormat = URLLoaderDataFormat.BINARY;
loader.addEventListener(Event.COMPLETE, onLoadingComplete );
loader.load( new URLRequest(file.url) );
private function onLoadingComplete( e: Event ):void
var loader: Loader = new Loader( );
loader.contentLoaderInfo.addEventListener( Event.COMPLETE, onParsingComplete );
loader.loadBytes( e.target.data );
private function onParsingComplete( e: Event ):void
var img: BitmapImage = new BitmapImage( );
img.source = (e.target.content as Bitmap).bitmapData;
_images.push( img );
private function onImageLoaded( e:Event ):void
var img: Image = e.target as Image;
img.removeEventListener( Event.COMPLETE, onImageLoaded );
_images.push( img );
See Anton's thread here: http://forums.adobe.com/message/2358653#2358653 -
Memory leaks in GC or something else on iOS
Hello.
I am making a game by Adobe AIR for iOS. My application has a memory leak bug with using only iOS.
So, I have some questions.
Why is it different using memory size of between Scout and Instruments VM Tracker (Dirty size) ?
Why is the difference increased between Scout and VM Tracker?I think, AIR makes memory leaks on GC when iOS alerts a low memory warning.
Can I catch GPU memory size ?
Rendering mode is 'gpu'.
I don't use Stage3D.
I think it is 'IOKit' dirty size of VM Tracker. Its right?
Scout gives no memory leaks. Instruments VM Tracker gives 50MB leaks for 20min.
1min ago. 162MB
20min ago. 162MB
Instruments 220MB -> 272MB
Scout overhead memory was about 1kB/min increasing.
I am sorry I have no small code to reproduce.
Environment:
iPad mini iOS7.0.4
AIR 3.9.0.1030Hi!
I think the virus did modify or delete some system files so are not able to boot in safe mode, print documents and so far.
Furthermore I must agree Raver. The best way would be to reinstall Windows with the recovery disk. This takes only few minutes but safe your data before. The HDD will be completely formatted.
If have reinstalled Windows, you should first install all Service Packs and Hotfixes (visit the Windows update website).
And dont forget to install a antivirus program like AntiVir (freeware).
Bye -
Memory leaks while playing mp3 in air 1.5
Hello,
I am trying to develop an mp3 player using Adobe Air (html + javascript). When I repeatedly load files using Sound class, memory usage is constantly increasing. I have observed this on OS X 10.6. using Activity Monitor. Air runtime is 1.5.3.9120
Steps to reproduce:
1. Load the sample below with adl
2. Click on play. Observer memory usage of adl in Activity monitor
3. Click on stop. The memory doesn't get reclaimed.
Keep repeating steps 2 and 3 and observe the memory in Activity monitor.
Any ideas as to why this happens? What am I doing wrong?
Regards,
Sasa
The example:
<html>
<head>
<script type="text/javascript" src="AIRIntrospector.js"></script>
<script type="text/javascript" src="AIRAliases.js"></script>
<script type="text/javascript">
function play(){
var req = new air.URLRequest("file://test.mp3");
snd = new air.Sound(req);
//channel = snd.play();
function stop(){
//channel.stop();
//channel = null;
snd = null;
function init(){
document.getElementById('play').onclick = play;
document.getElementById('stop').onclick = stop;
</script>
</head>
<body onload="init();">
<div id="play">play</div>
<div id="stop">stop</div>
</body>
</html>Normally I would agree about letting the gc collect. However, in my case, memory usage increases to 300 MB after 8 hours of playing. It seems that GC didn't collect or I have some more leaks.I didn't have the time to investigate this some more.
However, if gc doesn't collect for such a long time (possibly because there is more than enough free memory), I would prefer to invoke collection myself. If for no other reason, than because it doesn't look good for the end user to have perception that my app is using 300 MB when other applications are using only couple of MB up to 100 MB in the worst cases. -
We are implementing an AIR application that loads thumbnails
from the hard drive and uploads them to a remote server.
When bringing in large images, for example, when importing
five 2MB files into Image objects:
Flex reports that it is using 55MB
Windows reports using 220 Meg (viewing memory usage of
adl.exe in task manager)
After deletion of these image objects, the memory stays
allocated!! It is released when the application is closed.
Two issues I see:
1. Huge memory usage for image objects (I understand that JPG
files are exploded into BMPs). It limits our ability to load 10's
or 100's of images.
2. Bad Memory leak
OTHER THINGS WE TRIED:
1. Displaying images as inline html IMG tags.. Same memory
usage!
2. Taking a snapshot of the image and displaying that.
Problem, used way to much CPU
I hope these issues will be fixed before release time or we
are hosed.
PLATFORM: Windows XP Professional, service pack 2Hi
Have you tried the FB3 profiler to investigate why memory is
not getting deallocated?
You can use the loitering objects panel to track the back
references for the objects in memory. If you find that image object
is not being referenced by anything else. Can you file a bug at
http://bugs.adobe.com/flex
with a small test case.
Also as you know that jpg will be translated into bitmap. The
amount of memory required will be determined by the pixels in the
image. Each pixel will be 4K
Thanks,
Gaurav Jain
Flex SDK Team -
Adobe AIR 2.6 - memory leak when waiting on remote service call!
Our AIR app has a function to export data from a DataGrid to Excel, which calls out to our J2EE server to build the excel file, and is then returned to the client as a byteArray which can then be saved on the client machine. We have noticed that for large data sets over a few thousand rows, while the client is waiting for the server to return from the remote object service call, memory utilisation steadily increases and can reach 1GB. The bizarre thing is that this increase is noticed for the adl.exe memory utilisation as reported in Windows Task Manager, whereas when we use the Flashbuilder memory profiler to monitor the same process we see no increase in memory utilisation. Given that while the client is waiting on the server to return from this call the client isn't doing anything else, we are baffled as to why memory should be eaten up by the AIR runtime. Can anyone explain what is going on, and what steps we can take to stop this from occurring?
Many thanks,
MurrayAny chance you can check that out with the latest AIR?
Either way, it sounds like a bug, please report it at http://bugbase.adobe.com/ and then report the bug number here.
If you're able to provide a reproducable case that would really increase the chance that we can do something about it.
Thanks,
roymeo -
Fixing Memory Leaks in AIR App?
Hi Friends,
I'm been facing this memory leaks issue in our app and this has taken enough of our time and resources and we are not being able to find a solution for it.
I have identified the problem in the module where we primarily need memory related fixes which is - We are setting Repeater's recycleChildren() property to true/false based upon certain conditions which we cant change. Now when this property is set to false Repeater is supposed to be removing its last created objects from memory and creating fresh ones. In our case repeater is unable to delete those. When I managed to get their instances (using createdChildren()) and freed them in code I called System.gc() for releasing the memory back to OS. Now what is happening is that this approach works fine when I run the app from code but when I create its installer (from Installsheild) and formally out in on machines it does not work. I came to know the reason from following blogs:
http://jvalentino.blogspot.com/2009/05/flex-memory-issue-3-garbage-collection.html
http://gskinner.com/blog/archives/2006/06/as3_resource_ma.html
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/system/System.htm l#gc()
http://stackoverflow.com/questions/192373/force-garbage-collection-in-as3
http://gskinner.com/blog/archives/2006/08/as3_resource_ma_2.html
Guys, can anyone of you suggest what should I do here? This has become a delivery bottleneck and we need to give a fix where the memroy is released periodically and efficiently so that the end user's system does not hang.
Please help.
ShubhraAre you sure it doesn't ? Maybe flash does release memory but the OS leaves it assigned as described in the below comment from http://www.mikechambers.com/blog/2008/08/06/what-are-your-biggest-issues-with-adobe-air/co mment-page-3/#comment-26330
"I just finished doing more experiments, I looks like the AIR app does free the memory, but the OS leaves it assignned to the app process, until other apps requiere that memory. So, looks like it is a natural behaviour and the memory leak is not as terrible as I thougth." -
Adobe AIR memory leak loading SWFs
I was plagued by a memory leak that would crash my application after a few hours. The application had worked fine in the past but now was having issues and I thought it might have to do with using newer SDK's.
In the end I discovered that if I loaded external swf that had been compiled in debug mode, they would not clear completely on unload and cause a memory leak.
Compiling in release mode fixed the issue. Spent 3 days trying to figure it out.Any chance you can check that out with the latest AIR?
Either way, it sounds like a bug, please report it at http://bugbase.adobe.com/ and then report the bug number here.
If you're able to provide a reproducable case that would really increase the chance that we can do something about it.
Thanks,
roymeo -
Custom MediaStreamSource and Memory Leaks During SampleRequested
Greetings,
I have a nasty memory leak problem that is causing me to pull my hair out.
I'm implementing a custom MediaStreamSource along with MediaTranscoder to generate video to disk. The frame generation operation occurs in the SampleRequested handler (as in the MediaStreamSource example). No matter what I do - and I've tried a
ton of options - inevitably the app runs out of memory after a couple hundred frames of HD video. Investigating, I see that indeed GC.GetTotalMemory reports an increasing, and never decreasing, amount of allocated RAM.
The frame generator in my actual app is using RenderTargetBitmap to get screen captures, and is handing the buffer to MediaStreamSample.CreateFromBuffer(). However, as you can see in the example below, the issue occurs even with a dumb allocation
of RAM and no other actual logic. Here's the code:
void _mss_SampleRequested(Windows.Media.Core.MediaStreamSource sender, MediaStreamSourceSampleRequestedEventArgs args)
if ( args.Request.StreamDescriptor is VideoStreamDescriptor )
if (_FrameCount >= 3000) return;
var videoDeferral = args.Request.GetDeferral();
var descriptor = (VideoStreamDescriptor)args.Request.StreamDescriptor;
uint frameWidth = descriptor.EncodingProperties.Width;
uint frameHeight = descriptor.EncodingProperties.Height;
uint size = frameWidth * frameHeight * 4;
byte[] buffer = null;
try
buffer = new byte[size];
// do something to create the frame
catch
App.LogAction("Ran out of memory", this);
return;
args.Request.Sample = MediaStreamSample.CreateFromBuffer(buffer.AsBuffer(), TimeFromFrame(_FrameCount++, _frameSource.Framerate));
args.Request.Sample.Duration = TimeFromFrame(1, _frameSource.Framerate);
buffer = null; // attempt to release the memory
videoDeferral.Complete();
App.LogAction("Completed Video frame " + (_FrameCount-1).ToString() + "\n" +
"Allocated memory: " + GC.GetTotalMemory(true), this);
return;
It usually fails around frame 357, with GC.GetTotalMemory() reporting 750MB allocated.
I've tried tons of work-arounds, none of which made a difference. I tried putting the code that allocates the bytes in a separate thread - no dice. I tried Task.Delay to give the GC a chance to work, on the assumption that it just had no time
to do its job. No luck.
As another experiment, I wanted to see if the problem went away if I allocated memory each frame, but never assigned it to the MediaStreamSample, instead giving the sample (constant) dummy data. Indeed, in that scenario, memory consumption stayed
constant. However, while I never get an out-of-memory exception, RequestSample just stops getting called around frame 1600 and as a result the transcode operation never actually returns to completion.
I also tried taking a cue from the SDK sample which uses C++ entirely to generate the frame. So I passed the buffer as a Platform::Array<BYTE> to a static Runtime extension class function I wrote in C++.
I won't bore you with the C++ code, but even directly copying the bytes of the array to the media sample using memcpy still had the same result! It seems that there is no way to communicate the contents of the byte[] array to the media sample without
it never being released.
I know what some will say: the difference between my code and the SDK sample, of course, is that the SDK sample generates the frame _entirely_ in C++, thus taking care of its own memory allocation and deallocation. Because I want to get
the data from RenderTargetBitmap, this isn't an option for me. (As a side note, if anyone knows if there's a way to get the contents of an RT Window using DirectX, that might work too, but I know this is not a C++ forum, so...). But more importantly,
MediaStreamSource and MediaStreamSample are managed classes that appear to allow you to generate custom frames using C# or other managed code. The MediaStreamSample.CreateFromBuffer function appears to be tailored for exactly what I want. But there appears
to be no way to release the buffer when giving the bytes to the MediaStreamSample. At least none that I can find.
I know the RT version of these classes are new to Windows 8.1, but I did see other posts going back 3 years discussing a similar issue in Silverlight. That never appears to have been resolved.
I guess the question boils down to this: how do I safely get managed data, allocated during the SampleRequested handler, to the MediaStreamSample without causing a memory leak? Also, why would the SampleRequested handler just stop getting called
out of the blue, even when I artificially eliminate the memory leak problem?
Thanks so much for all input!Hi Rob -
Thanks for your quick reply and for clarifying the terminology.
In the Memory Usage test under Analyze/Performance and Diagnostics (is that what you mean?) it's clear that each frame of video being created is not released from memory except when memory consumption gets very high. GC will occasionally kick in, but eventually
it succumbs.
Interestingly, if I reduce the frame size substantially, say 320x240, it never runs out of RAM no matter how many frames I throw at it. The Memory Usage test, however, shows the same pattern. But this time the GC can keep up and release the RAM.
After playing with this ad nauseum, I am fairly convinced I know what the problem is, but the solution still escapes me. It appears that the Transcoder is requesting frames from the MediaStreamSource (and the MediaStreamSource is providing them via
my SampleRequested handler) faster than the Transcoder can write them to disk and release them. Why would this be happening? The MediaStreamSource.BufferTime property is - I thought - used to prevent this very problem. However, changing the BufferTime seems
to have no effect at all - even changing it to ZERO doesn't change anything. If I'm right, this would explain why the GC can't do its job - it can't release the buffers I'm giving to the Transcoder via SampleRequested because the Transcoder won't give them
up until it's finished transcoding and writing them to disk. And yet the transcoder keeps requesting samples until there's no more memory to create them with.
The following code, which I made from scratch to illustrate my scenario, should be air-tight according to everything I've read. And yet, it still runs out of memory when the frame size is too large.
If you or anyone else can spot the problem in this code, I'd be thrilled to hear it. Maybe I'm omitting a key step with regard to getting the deferral? Or maybe it's a bug in the back-end? Can I "slow down" the transcoder and force it to release samples
it's already used?
Anyway here's the new code, which other than App.cs is everything. So if I'm doing something wrong it will be in this module:
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using System.Diagnostics;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
using Windows.UI.Popups;
using Windows.Storage;
using Windows.Storage.Pickers;
using Windows.Storage.Streams;
using Windows.Media.MediaProperties;
using Windows.Media.Core;
using Windows.Media.Transcoding;
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
namespace MyTranscodeTest
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class MainPage : Page
MediaTranscoder _transcoder;
MediaStreamSource _mss;
VideoStreamDescriptor _videoSourceDescriptor;
const int c_width = 1920;
const int c_height = 1080;
const int c_frames = 10000;
const int c_frNumerator = 30000;
const int c_frDenominator = 1001;
uint _frameSizeBytes;
uint _frameDurationTicks;
uint _transcodePositionTicks = 0;
uint _frameCurrent = 0;
Random _random = new Random();
public MainPage()
this.InitializeComponent();
private async void GoButtonClicked(object sender, RoutedEventArgs e)
Windows.Storage.Pickers.FileSavePicker picker = new Windows.Storage.Pickers.FileSavePicker();
picker.FileTypeChoices.Add("MP4 File", new List<string>() { ".MP4" });
Windows.Storage.StorageFile file = await picker.PickSaveFileAsync();
if (file == null) return;
Stream outputStream = await file.OpenStreamForWriteAsync();
var transcodeTask = (await this.InitializeTranscoderAsync(outputStream)).TranscodeAsync();
transcodeTask.Progress = (asyncInfo, progressInfo) =>
Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
_ProgressReport.Text = "Sourcing frame " + _frameCurrent.ToString() + " of " + c_frames.ToString() +
" with " + GC.GetTotalMemory(false).ToString() + " bytes allocated.";
await transcodeTask;
MessageDialog dialog = new MessageDialog("Transcode completed.");
await dialog.ShowAsync();
async Task<PrepareTranscodeResult> InitializeTranscoderAsync (Stream output)
_transcoder = new MediaTranscoder();
_transcoder.HardwareAccelerationEnabled = false;
_videoSourceDescriptor = new VideoStreamDescriptor(VideoEncodingProperties.CreateUncompressed( MediaEncodingSubtypes.Bgra8, c_width, c_height ));
_videoSourceDescriptor.EncodingProperties.PixelAspectRatio.Numerator = 1;
_videoSourceDescriptor.EncodingProperties.PixelAspectRatio.Denominator = 1;
_videoSourceDescriptor.EncodingProperties.FrameRate.Numerator = c_frNumerator;
_videoSourceDescriptor.EncodingProperties.FrameRate.Denominator = c_frDenominator;
_videoSourceDescriptor.EncodingProperties.Bitrate = (uint)((c_width * c_height * 4 * 8 * (ulong)c_frDenominator) / (ulong)c_frNumerator);
_frameDurationTicks = (uint)(10000000 * (ulong)c_frDenominator / (ulong)c_frNumerator);
_frameSizeBytes = c_width * c_height * 4;
_mss = new MediaStreamSource(_videoSourceDescriptor);
_mss.BufferTime = TimeSpan.FromTicks(_frameDurationTicks);
_mss.Duration = TimeSpan.FromTicks( _frameDurationTicks * c_frames );
_mss.Starting += _mss_Starting;
_mss.Paused += _mss_Paused;
_mss.SampleRequested += _mss_SampleRequested;
MediaEncodingProfile outputProfile = MediaEncodingProfile.CreateMp4(VideoEncodingQuality.Ntsc);
outputProfile.Audio = null;
return await _transcoder.PrepareMediaStreamSourceTranscodeAsync(_mss, output.AsRandomAccessStream(), outputProfile);
void _mss_Paused(MediaStreamSource sender, object args)
throw new NotImplementedException();
void _mss_Starting(MediaStreamSource sender, MediaStreamSourceStartingEventArgs args)
args.Request.SetActualStartPosition(new TimeSpan(0));
/// <summary>
/// This is derived from the sample in "Windows 8.1 Apps with Xaml and C# Unleashed"
/// </summary>
/// <param name="sender"></param>
/// <param name="args"></param>
void _mss_SampleRequested(MediaStreamSource sender, MediaStreamSourceSampleRequestedEventArgs args)
if (_frameCurrent == c_frames) return;
var deferral = args.Request.GetDeferral();
byte[] frameBuffer;
try
frameBuffer = new byte[_frameSizeBytes];
this._random.NextBytes(frameBuffer);
catch
throw new Exception("Sample source ran out of RAM");
args.Request.Sample = MediaStreamSample.CreateFromBuffer(frameBuffer.AsBuffer(), TimeSpan.FromTicks(_transcodePositionTicks));
args.Request.Sample.Duration = TimeSpan.FromTicks(_frameDurationTicks);
args.Request.Sample.KeyFrame = true;
_transcodePositionTicks += _frameDurationTicks;
_frameCurrent++;
deferral.Complete();
Again, I can't see any reason why this shouldn't work. You'll note it mirrors pretty closely the sample in the Windows 8.1 Apps With Xaml Unleashed book (Chapter 14). The difference is I'm feeding the samples to a transcoder rather than a MediaElement (which,
again should be no issue).
Thanks again for any suggestions!
Peter -
Memory leak in Jeditorpane.setText method while displaying html content
I tried to display a larger size html page using JeditorPane. But I found that there as a huge memory leak after JEditorPane's setText method was called.
Refering to the below code there was a difference of about 40 MB after the setText method was called.This does not happen if we display the page in rtf format.This finally results in Out Of memry error.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
import java.awt.BorderLayout;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import javax.swing.JEditorPane;
import javax.swing.JFrame;
public class SampleProgram extends JFrame{
public JEditorPane pane;
static public String getContents(File aFile) {
StringBuffer contents = new StringBuffer();
try {
BufferedReader input = new BufferedReader(new FileReader(aFile));
try {
String line = null;
while (( line = input.readLine()) != null){
contents.append(line);
contents.append(System.getProperty("line.separator"));
finally {
input.close();
catch (IOException ex){
ex.printStackTrace();
return contents.toString();
public SampleProgram() {
pane = new JEditorPane();
pane.setContentType("text/html");
pane.setEditable(false);
pane.setCaretPosition(0);
pane.setAutoscrolls(true);
getContentPane().add(pane, BorderLayout.CENTER);
setSize(400,400);
File file = new File("D:/Audit_Log.html");
String summary = getContents(file);
System.out.println("Memory used Before setText invoke ==>" +((Runtime.getRuntime().totalMemory()- Runtime.getRuntime().freeMemory())/1000000)+"M");
pane.setText(summary);
System.out.println("Memory used after setText invoke ==>" +((Runtime.getRuntime().totalMemory()- Runtime.getRuntime().freeMemory())/1000000)+"M");
setVisible(true);
* @param args
public static void main(String[] args) {
new SampleProgram () ;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The html i am trying to display is similar to the one below.But the original content almost 10 times bigger than this html content and it has only td and tr tags. and for this file the leak is about 4 MB and if I use the file 10 times bigger than this it is 40M .
Any suggestions how to avoid this memory leak?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<html>
<body>
<h1 align="center">Test HTML</h1>
<table align="center" border="0" width="90%">
<tr>
<td>
<h3>10-Sep-2008 08:11:32 GMT - <i>User</i>
</h3>
<h4>Employee 1 - <i>Create</i>
</h4>
<table border="0" width="100%">
<th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
<tr>
<td>Name</td><td></td><td>xyzxyz</td>
</tr>
<tr>
<td>Place</td><td></td><td>Mangalore</td>
</tr>
<tr>
<td>State</td><td></td><td>Karnataka</td>
</tr>
<tr>
<td>Country</td><td></td><td>India</td>
</tr>
<tr>
<td>Continent</td><td></td><td>Asia</td>
</tr>
<tr>
<td>Indicator</td><td></td><td>Green</td>
</tr>
<tr>
<td>vision</td><td></td><td>Asia</td>
</tr>
</table>
<br>
<h4>Employee 2 - <i>Create</i>
</h4>
<table border="0" width="100%">
<th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
<tr>
<td>Name</td><td></td><td>xyzxyz</td>
</tr>
<tr>
<td>Place</td><td></td><td>Mangalore</td>
</tr>
<tr>
<td>State</td><td></td><td>Karnataka</td>
</tr>
<tr>
<td>Country</td><td></td><td>India</td>
</tr>
<tr>
<td>Continent</td><td></td><td>Asia</td>
</tr>
<tr>
<td>Indicator</td><td></td><td>Green</td>
</tr>
<tr>
<td>vision</td><td></td><td>Asia</td>
</tr>
</table>
<br>
<h4>Employee 3, - <i>Create</i>
</h4>
<table border="0" width="100%">
<th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
<tr>
<td>Name</td><td></td><td>xyzxyz</td>
</tr>
<tr>
<td>Place</td><td></td><td>Mangalore</td>
</tr>
<tr>
<td>State</td><td></td><td>Karnataka</td>
</tr>
<tr>
<td>Country</td><td></td><td>India</td>
</tr>
<tr>
<td>Continent</td><td></td><td>Asia</td>
</tr>
<tr>
<td>Indicator</td><td></td><td>Green</td>
</tr>
<tr>
<td>vision</td><td></td><td>Asia</td>
</tr>
</table>
<br>
<h4>Employee 4, - <i>Create</i>
</h4>
<table border="0" width="100%">
<th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
<tr>
<td>Name</td><td></td><td>xyzxyz</td>
</tr>
<tr>
<td>Place</td><td></td><td>Mangalore</td>
</tr>
<tr>
<td>State</td><td></td><td>Karnataka</td>
</tr>
<tr>
<td>Country</td><td></td><td>India</td>
</tr>
<tr>
<td>Continent</td><td></td><td>Asia</td>
</tr>
<tr>
<td>Indicator</td><td></td><td>Green</td>
</tr>
<tr>
<td>vision</td><td></td><td>Asia</td>
</tr>
</table>
<br>
<h4>Employee 5, - <i>Create</i>
</h4>
<table border="0" width="100%">
<th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
<tr>
<td>Name</td><td></td><td>xyzxyz</td>
</tr>
<tr>
<td>Place</td><td></td><td>Mangalore</td>
</tr>
<tr>
<td>State</td><td></td><td>Karnataka</td>
</tr>
<tr>
<td>Country</td><td></td><td>India</td>
</tr>
<tr>
<td>Continent</td><td></td><td>Asia</td>
</tr>
<tr>
<td>Indicator</td><td></td><td>Green</td>
</tr>
<tr>
<td>vision</td><td></td><td>Asia</td>
</tr>
</table>
<br>
<h4>Employee 6, - <i>Create</i>
</h4>
<table border="0" width="100%">
<th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
<tr>
<td>Name</td><td></td><td>xyzxyz</td>
</tr>
<tr>
<td>Place</td><td></td><td>Mangalore</td>
</tr>
<tr>
<td>State</td><td></td><td>Karnataka</td>
</tr>
<tr>
<td>Country</td><td></td><td>India</td>
</tr>
<tr>
<td>Continent</td><td></td><td>Asia</td>
</tr>
<tr>
<td>Indicator</td><td></td><td>Green</td>
</tr>
<tr>
<td>vision</td><td></td><td>Asia</td>
</tr>
</table>
<br>
<h4>Employee 7, - <i>Create</i>
</h4>
<table border="0" width="100%">
<th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
<tr>
<td>Name</td><td></td><td>xyzxyz</td>
</tr>
<tr>
<td>Place</td><td></td><td>Mangalore</td>
</tr>
<tr>
<td>State</td><td></td><td>Karnataka</td>
</tr>
<tr>
<td>Country</td><td></td><td>India</td>
</tr>
<tr>
<td>Continent</td><td></td><td>Asia</td>
</tr>
<tr>
<td>Indicator</td><td></td><td>Green</td>
</tr>
<tr>
<td>vision</td><td></td><td>Asia</td>
</tr>
</table>
<br>
<h4>Employee 8, - <i>Create</i>
</h4>
<table border="0" width="100%">
<th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
<tr>
<td>Name</td><td></td><td>xyzxyz</td>
</tr>
<tr>
<td>Place</td><td></td><td>Mangalore</td>
</tr>
<tr>
<td>State</td><td></td><td>Karnataka</td>
</tr>
<tr>
<td>Country</td><td></td><td>India</td>
</tr>
<tr>
<td>Continent</td><td></td><td>Asia</td>
</tr>
<tr>
<td>Indicator</td><td></td><td>Green</td>
</tr>
<tr>
<td>vision</td><td></td><td>Asia</td>
</tr>
</table>
<br>
<h4>Employee 9, - <i>Create</i>
</h4>
<table border="0" width="100%">
<th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
<tr>
<td>Name</td><td></td><td>xyzxyz</td>
</tr>
<tr>
<td>Place</td><td></td><td>Mangalore</td>
</tr>
<tr>
<td>State</td><td></td><td>Karnataka</td>
</tr>
<tr>
<td>Country</td><td></td><td>India</td>
</tr>
<tr>
<td>Continent</td><td></td><td>Asia</td>
</tr>
<tr>
<td>Indicator</td><td></td><td>Green</td>
</tr>
<tr>
<td>vision</td><td></td><td>Asia</td>
</tr>
</table>
<br>
<h4>Employee 10, - <i>Create</i>
</h4>
<table border="0" width="100%">
<th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
<tr>
<td>Name</td><td></td><td>xyzxyz</td>
</tr>
<tr>
<td>Place</td><td></td><td>Mangalore</td>
</tr>
<tr>
<td>State</td><td></td><td>Karnataka</td>
</tr>
<tr>
<td>Country</td><td></td><td>India</td>
</tr>
<tr>
<td>Continent</td><td></td><td>Asia</td>
</tr>
<tr>
<td>Indicator</td><td></td><td>Green</td>
</tr>
<tr>
<td>vision</td><td></td><td>Asia</td>
</tr>
</table>
<br>
<h4>Employee 11, - <i>Create</i>
</h4>
<table border="0" width="100%">
<th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
<tr>
<td>Name</td><td></td><td>xyzxyz</td>
</tr>
<tr>
<td>Place</td><td></td><td>Mangalore</td>
</tr>
<tr>
<td>State</td><td></td><td>Karnataka</td>
</tr>
<tr>
<td>Country</td><td></td><td>India</td>
</tr>
<tr>
<td>Continent</td><td></td><td>Asia</td>
</tr>
<tr>
<td>Indicator</td><td></td><td>Green</td>
</tr>
<tr>
<td>vision</td><td></td><td>Asia</td>
</tr>
</table>
<br>
<h4>Employee 12, - <i>Create</i>
</h4>
<table border="0" width="100%">
<th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
<tr>
<td>Name</td><td></td><td>xyzxyz</td>
</tr>
<tr>
<td>Place</td><td></td><td>Mangalore</td>
</tr>
<tr>
<td>State</td><td></td><td>Karnataka</td>
</tr>
<tr>
<td>Country</td><td></td><td>India</td>
</tr>
<tr>
<td>Continent</td><td></td><td>Asia</td>
</tr>
<tr>
<td>Indicator</td><td></td><td>Green</td>
</tr>
<tr>
<td>vision</td><td></td><td>Asia</td>
</tr>
</table>
<br>
<h4>Employee 13, - <i>Create</i>
</h4>
<table border="0" width="100%">
<th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
<tr>
<td>Name</td><td></td><td>xyzxyz</td>
</tr>
<tr>
<td>Place</td><td></td><td>Mangalore</td>
</tr>
<tr>
<td>State</td><td></td><td>Karnataka</td>
</tr>
<tr>
<td>Country</td><td></td><td>India</td>
</tr>
<tr>
<td>Continent</td><td></td><td>Asia</td>
</tr>
<tr>
<td>Indicator</td><td></td><td>Green</td>
</tr>
<tr>
<td>vision</td><td></td><td>Asia</td>
</tr>
</table>
<br>
<h4>Employee 14, - <i>Create</i>
</h4>
<table border="0" width="100%">
<th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
<tr>
<td>Name</td><td></td><td>xyzxyz</td>
</tr>
<tr>
<td>Place</td><td></td><td>Mangalore</td>
</tr>
<tr>
<td>State</td><td></td><td>Karnataka</td>
</tr>
<tr>
<td>Country</td><td></td><td>India</td>
</tr>
<tr>
<td>Continent</td><td></td><td>Asia</td>
</tr>
<tr>
<td>Indicator</td><td></td><td>Green</td>
</tr>
<tr>
<td>vision</td><td></td><td>Asia</td>
</tr>
</table>
<br>
<h4>Employee 15, - <i>Create</i>
</h4>
<table border="0" width="100%">
<th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
<tr>
<td>Name</td><td></td><td>xyzxyz</td>
</tr>
<tr>
<td>Place</td><td></td><td>Mangalore</td>
</tr>
<tr>
<td>State</td><td></td><td>Karnataka</td>
</tr>
<tr>
<td>Country</td><td></td><td>India</td>
</tr>
<tr>
<td>Continent</td><td></td><td>Asia</td>
</tr>
<tr>
<td>Indicator</td><td></td><td>Green</td>
</tr>
<tr>
<td>vision</td><td></td><td>Asia</td>
</tr>
</table>
<br>
<h4>Employee 16, - <i>Create</i>
</h4>
<table border="0" width="100%">
<th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
<tr>
<td>Name</td><td></td><td>xyzxyz</td>
</tr>
<tr>
<td>Place</td><td></td><td>Mangalore</td>
</tr>
<tr>
<td>State</td><td></td><td>Karnataka</td>
</tr>
<tr>
<td>Country</td><td></td><td>India</td>
</tr>
<tr>
<td>Continent</td><td></td><td>Asia</td>
</tr>
<tr>
<td>Indicator</td><td></td><td>Green</td>
</tr>
<tr>
<td>vision</td><td></td><td>Asia</td>
</tr>
</table>
<br>
<h4>Employee 17, - <i>Create</i>
</h4>
<table border="0" width="100%">
<th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
<tr>
<td>Name</td><td></td><td>xyzxyz</td>
</tr>
<tr>
<td>Place</td><td></td><td>Mangalore</td>
</tr>
<tr>
<td>State</td><td></td><td>Karnataka</td>
</tr>
<tr>
<td>Country</td><td></td><td>India</td>
</tr>
<tr>
<td>Continent</td><td></td><td>Asia</td>
</tr>
<tr>
<td>Indicator</td><td></td><td>Green</td>
</tr>
<tr>
<td>vision</td><td></td><td>Asia</td>
</tr>
</table>
<br>
<h4>Employee 18, - <i>Create</i>
</h4>
<table border="0" width="100%">
<th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
<tr>
<td>Name</td><td></td><td>xyzxyz</td>
</tr>
<tr>
<td>Place</td><td></td><td>Mangalore</td>
</tr>
<tr>
<td>State</td><td></td><td>Karnataka</td>
</tr>
<tr>
<td>Country</td><td></td><td>India</td>
</tr>
<tr>
<td>Continent</td><td></td><td>Asia</td>
</tr>
<tr>
<td>Indicator</td><td></td><td>Green</td>
</tr>
<tr>
<td>vision</td><td></td><td>Asia</td>
</tr>
</table>
<br>
<h4>Employee 19, - <i>Create</i>
</h4>
<table border="0" width="100%">
<th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
<tr>
<td>Name</td><td></td><td>xyzxyz</td>
</tr>
<tr>
<td>Place</td><td></td><td>Mangalore</td>
</tr>
<tr>
<td>State</td><td></td><td>Karnataka</td>
</tr>
<tr>
<td>Country</td><td></td><td>India</td>
</tr>
<tr>
<td>Continent</td><td></td><td>Asia</td>
</tr>
<tr>
<td>Indicator</td><td></td><td>Green</td>
</tr>
<tr>
<td>vision</td><td></td><td>Asia</td>
</tr>
</table>
<br>
<h4>Employee 20, - <i>Create</i>
</h4>
<table border="0" width="100%">
<th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
<tr>
<td>Name</td><td></td><td>xyzxyz</td>
</tr>
<tr>
<td>Place</td><td></td><td>Mangalore</td>
</tr>
<tr>
<td>State</td><td></td><td>Karnataka</td>
</tr>
<tr>
<td>Country</td><td></td><td>India</td>
</tr>
<tr>
<td>Continent</td><td></td><td>Asia</td>
</tr>
<tr>
<td>Indicator</td><td></td><td>Green</td>
</tr>
<tr>
<td>vision</td><td></td><td>Asia</td>
</tr>
</table>
<br>
<h4>Employee 21, - <i>Create</i>
</h4>
<table border="0" width="100%">
<th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
<tr>
<td>Name</td><td></td><td>xyzxyz</td>
</tr>
<tr>
<td>Place</td><td></td><td>Mangalore</td>
</tr>
<tr>
<td>State</td><td></td><td>Karnataka</td>
</tr>
<tr>
<td>Country</td><td></td><td>India</td>
</tr>
<tr>
<td>Continent</td><td></td><td>Asia</td>
</tr>
<tr>
<td>Indicator</td><td></td><td>Green</td>
</tr>
<tr>
<td>vision</td><td></td><td>Asia</td>
</tr>
</table>
<br>
<h4>Employee 22, - <i>Create</i>
</h4>
<table border="0" width="100%">
<th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
<tr>
<td>Name</td><td></td><td>xyzxyz</td>
</tr>
<tr>
<td>Place</td><td></td><td>Mangalore</td>
</tr>
<tr>
<td>State</td><td></td><td>Karnataka</td>
</tr>
<tr>
<td>Country</td><td></td><td>India</td>
</tr>
<tr>
<td>Continent</td><td></td><td>Asia</td>
</tr>
<tr>
<td>Indicator</td><td></td><td>Green</td>
</tr>
<tr>
<td>vision</td><td></td><td>Asia</td>
</tr>
</table>
<br>
<h4>Employee 23, - <i>Create</i>
</h4>
<table border="0" width="100%">
<th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
<tr>
<td>Name</td><td></td><td>xyzxyz</td>
</tr>
<tr>
<td>Place</td><td></td><td>Mangalore</td>
</tr>
<tr>
<td>State</td><td></td><td>Karnataka</td>
</tr>
<tr>
<td>Country</td><td></td><td>India</td>
</tr>
<tr>
<td>Continent</td><td></td><td>Asia</td>
</tr>
<tr>
<td>Indicator</td><td></td><td>Green</td>
</tr>
<tr>
<td>vision</td><td></td><td>Asia</td>
</tr>
</table>
<br>
<h4>Employee 24, - <i>Create</i>
</h4>
<table border="0" width="100%">
<th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
<tr>
<td>Name</td><td></td><td>xyzxyz</td>
</tr>
<tr>
<td>Place</td><td></td><td>Mangalore</td>
</tr>
<tr>
<td>State</td><td></td><td>Karnataka</td>
</tr>
<tr>
<td>Country</td><td></td><td>India</td>
</tr>
<tr>
<td>Continent</td><td></td><td>Asia</td>
</tr>
<tr>
<td>Indicator</td><td></td><td>Green</td>
</tr>
<tr>
<td>vision</td><td></td><td>Asia</td>
</tr>
</table>
<br>
<h4>Employee 25, - <i>Create</i>
</h4>
<table border="0" width="100%">
<th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
<tr>
<td>Name</td><td></td><td>xyzxyz</td>
</tr>
<tr>
<td>Place</td><td></td><td>Mangalore</td>
</tr>
<tr>
<td>State</td><td></td><td>Karnataka</td>
</tr>
<tr>
<td>Country</td><td></td><td>India</td>
</tr>
<tr>
<td>Continent</td><td></td><td>Asia</td>
</tr>
<tr>
<td>Indicator</td><td></td><td>Green</td>
</tr>
<tr>
<td>vision</td><td></td><td>Asia</td>
</tr>
</table>
<br>
<h4>Employee 26, - <i>Create</i>
</h4>
<table border="0" width="100%">
<th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
<tr>
<td>Name</td><td></td><td>xyzxyz</td>
</tr>
<tr>
<td>Place</td><td></td><td>Mangalore</td>
</tr>
<tr>
<td>State</td><td></td><td>Karnataka</td>
</tr>
<tr>
<td>Country</td><td></td><td>India</td>
</tr>
<tr>
<td>Continent</td><td></td><td>Asia</td>
</tr>
<tr>
<td>Indicator</td><td></td><td>Green</td>
</tr>
<tr>
<td>vision</td><td></td><td>Asia</td>
</tr>
</table>
<br>
<h4>Employee 27, - <i>Create</i>
</h4>
<table border="0" width="100%">
<th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
<tr>
<td>Name</td><td></td><td>xyzxyz</td>
</tr>
<tr>
<td>Place</td><td></td><td>Mangalore</td>
</tr>
<tr>
<td>State</td><td></td><td>Karnataka</td>
</tr>
<tr>
<td>Country</td><td></td><td>India</td>
</tr>
<tr>
<td>Continent</td><td></td><td>Asia</td>
</tr>
<tr>
<td>Indicator</td><td></td><td>Green</td>
</tr>
<tr>
<td>vision</td><td></td><td>Asia</td>
</tr>
</table>
<br>
<h4>Employee 28, - <i>Create</i>
</h4>
<table border="0" width="100%">
<th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
<tr>
<td>Name</td><td></td><td>xyzxyz</td>
</tr>
<tr>
<td>Place</td><td></td><td>Mangalore</td>
</tr>
<tr>
<td>State</td><td></td><td>Karnataka</td>
</tr>
<tr>
<td>Country</td><td></td><td>India</td>
</tr>
<tr>
<td>Continent</td><td></td><td>Asia</td>
</tr>
<tr>
<td>Indicator</td><td></td><td>Green</td>
</tr>
<tr>
<td>vision</td><td></td><td>Asia</td>
</tr>
</table>
<br>
<h4>Employee 29, - <i>Create</i>
</h4>
<table border="0" width="100%">
<th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
<tr>
<td>Name</td><td></td><td>xyzxyz</td>
</tr>
<tr>
<td>Place</td><td></td><td>Mangalore</td>
</tr>
<tr>
<td>State</td><td></td><td>Karnataka</td>
</tr>
<tr>
<td>Country</td><td></td><td>India</td>
</tr>
<tr>
<td>Continent</td><td></td><td>Asia</td>
</tr>
<tr>
<td>Indicator</td><td></td><td>Green</td>
</tr>
<tr>
<td>vision</td><td></td><td>Asia</td>
</tr>
</table>
<br>
<h4>Employee 30, - <i>Create</i>
</h4>
<table border="0" width="100%">
<th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
<tr>
<td>Name</td><td></td><td>xyzxyz</td>
</tr>
<tr>
<td>Place</td><td></td><td>Mangalore</td>
</tr>
<tr>
<td>State</td><td></td><td>Karnataka</td>
</tr>
<tr>
<td>Country</td><td></td><td>India</td>
</tr>
<tr>
<td>Continent</td><td></td><td>Asia</td>
</tr>
<tr>
<td>Indicator</td><td></td><td>Green</td>
</tr>
<tr>
<td>vision</td><td></td><td>Asia</td>
</tr>
</table>
<br>
<h4>Employee 31, - <i>Create</i>
</h4>
<table border="0" width="100%">
<th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
<tr>
<td>Name</td><td></td><td>xyzxyz</td>
</tr>
<tr>
<td>Place</td><td></td><td>Mangalore</td>
</tr>
<tr>
<td>State</td><td></td><td>Karnataka</td>
</tr>
<tr>
<td>Country</td><td></td><td>India</td>
</tr>
<tr>
<td>Continent</td><td></td><td>Asia</td>
</tr>
<tr>
<td>Indicator</td><td></td><td>Green</td>
</tr>
<tr>
<td>vision</td><td></td><td>Asia</td>
</tr>
</table>
<br>
<h4>Employee 32, - <i>Create</i>
</h4>
<table border="0" width="100%">
<th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
<tr>
<td>Name</td><td></td><td>xyzxyz</td>
</tr>
<tr>
<td>Place</td><td></td><td>Mangalore</td>
</tr>
<tr>
<td>State</td><td></td><td>Karnataka</td>
</tr>
<tr>
<td>Country</td><td></td><td>India</td>
</tr>
<tr>
<td>Continent</td><td></td><td>Asia</td>
</tr>
<tr>
<td>Indicator</td><td></td><td>Green</td>
</tr>
<tr>
<td>vision</td><td></td><td>Asia</td>
</tr>
</table>
<br>
<h4>Employee 33, - <i>Create</i>
</h4>
<table border="0" width="100%">
<th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
<tr>
<td>Name</td><td></td><td>xyzxyz</td>
</tr>
<tr>
<td>Place</td><td></td><td>Mangalore</td>
</tr>
<tr>
<td>State</td><td></td><td>Karnataka</td>
</tr>
<tr>
<td>Country</td><td></td><td>India</td>
</tr>
<tr>
<td>Continent</td><td></td><td>Asia</td>
</tr>
<tr>
<td>Indicator</td><td></td><td>Green</td>
</tr>
<tr>
<td>vision</td><td></td><td>Asia</td>
</tr>
</table>
<br>
<h4>Employee 34, - <i>Create</i>
</h4>
<table border="0" width="100%">
<th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
<tr>
<td>Name</td><td></td><td>xyzxyz</td>
</tr>
<tr>
<td>Place</td><td></td><td>Mangalore</td>
</tr>
<tr>
<td>State</td><td></td><td>Karnataka</td>
</tr>
<tr>
<td>Country</td><td></td><td>India</td>
</tr>
<tr>
<td>Continent</td><td></td><td>Asia</td>
</tr>
<tr>
<td>Indicator</td><td></td><td>Green</td>
</tr>
<tr>
<td>vision</td><td></td><td>Asia</td>
</tr>
</table>
<br>
<h4>Employee 35, - <i>Create</i>
</h4>
<table border="0" width="100%">
<th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
<tr>
<td>Name</td><td></td><td>xyzxyz</td>
</tr>
<tr>
<td>Place</td><td></td><td>Mangalore</td>
</tr>
<tr>
<td>State</td><td></td><td>Karnataka</td>
</tr>
<tr>
<td>Country</td><td></td><td>India</td>
</tr>
<tr>
<td>Continent</td><td></td><td>Asia</td>
</tr>
<tr>
<td>Indicator</td><td></td><td>Green</td>
</tr>
<tr>
<td>vision</td><td></td><td>Asia</td>
</tr>
</table>
<br>
<h4>Employee 36, - <i>Create</i>
</h4>
<table border="0" width="100%">
<th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
<tr>
<td>Name</td><td></td><td>xyzxyz</td>
</tr>
<tr>
<td>Place</td><td></td><td>Mangalore</td>
</tr>
<tr>
<td>State</td><td></td><td>Karnataka</td>
</tr>
<tr>
<td>Country</td><td></td><td>India</td>
</tr>
<tr>
<td>Continent</td><td></td><td>Asia</td>
</tr>
<tr>
<td>Indicator</td><td></td><td>Green</td>
</tr>
<tr>
<td>vision</td><td></td><td>Asia</td>
</tr>
</table>
<br>
<h4>Employee 37, - <i>Create</i>
</h4>
<table border="0" width="100%">
<th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
<tr>
<td>Name</td><td></td><td>xyzxyz</td>
</tr>
<tr>
<td>Place</td><td></td><td>Mangalore</td>
</tr>
<tr>
<td>State</td><td></td><td>Karnataka</td>
</tr>
<tr>
<td>Country</td><td></td><td>India</td>
</tr>
<tr>
<td>Continent</td><td></td><td>Asia</td>
</tr>
<tr></tr>
<tr>
<td>Unit </td><td></td><td>India/MT</td>
</tr>
<tr>
<td>Floor</td><td></td><td>MARblE</td>
</tr>
<tr>
<td>Rating</td><td></td><td>Quantity: amount = 45 uom = MT</td>
</tr>
</table>
<br>
<h4>Employee 60, Employed - <i>Create</i>
</h4>
<table border="0" width="100%">
<th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
<tr>
<td>Price</td><td></td><td>India/MT</td>
</tr>
</table>
<br>
<h4>Employee 61, Employee - <i>Create</i>
</h4>
<table border="0" width="100%">
<th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
<tr>
<td>Accept the agreement</td><td></td><td>Asia</td>
</tr>
<tr>
<td>Indicator</td><td></td><td>True</td>
</tr>
<tr>
<td>Conditions</td><td></td><td>AIR</td>
</tr>
<tr>
<td> Status</td><td></td><td>QUALIFIED</td>
</tr>
<tr>
<td>Job Type</td><td></td><td>ddddd</td>
</tr>
<tr>
<td>agreement signed</td><td></td><td>TRUE</td>
</tr>
<tr>
<td>Degree</td><td></td><td>True</td>
</tr>
<tr>
<td> Options</td><td></td><td>Asia</td>
</tr>
<tr>
<td>Quality</td><td></td><td>TRUE</td>
</tr>
<tr>
<td>Quantity</td><td></td><td>123</td>
</tr>
<tr>
<td>Basis</td><td></td><td>TOTAL</td>
</tr>
<tr>
<td>GapPresent</td><td></td><td>TRUE</td>
</tr>
<tr>
<td>Unit </td><td></td><td>MT</td>
</tr>
<tr>
<td>Warning</td><td></td><td>4000000</td>
</tr>
<tr>
<td>Rounding </td><td></td><td>3</td>
</tr>
<tr>
<td>Security</td><td></td><td>OC</td>
</tr>
<tr>
<td>Number</td><td></td><td>61</td>
</tr>
<tr>
<td>Employee Status</td><td></td><td>Rupee INDIA</td>
</tr>
</table>
<br>
<h4>Employee 61 - <i>Create</i>
</h4>
<table border="0" width="100%">
<th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
<tr>
<td>Alternative </td><td></td><td>Asia</td>
</tr>
<tr>
<td>Advantage</td><td></td><td>all</td>
</tr>
<tr>
<td>Loading</td><td></td><td>all</td>
</tr>
<tr>
<td>flag</td><td></td><td>Asia</td>
</tr>
<tr>
<td>Lateral</td><td></td><td>True</td>
</tr>
<tr>
<td> Mode</td><td></td><td>Null</td>
</tr>
</table>
<br>
<h4>Employee 61, Chain - <i>Create</i>
</h4>
<table border="0" width="100%">
<th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
<tr>
<td>Roll Number</td><td></td><td>1</td>
</tr>
<tr>
<td>Section</td><td></td><td>AA</td>
</tr>
<tr>
<td>Percentage</td><td></td><td>100</td>
</tr>
</table>
<br>
<h4>Employee 61, Employee Terms - <i>Create</i>
</h4>
<table border="0" width="100%">
<th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
<tr>
<td>Date of Record</td><td></td><td>DateRange
startDate=01-Jun-2009
endDate=30-Jun-2009
</td>
</tr>
<tr>
<td>Continent</td><td></td><td>Asia</td>
</tr>
</table>
<br>
<h4>Employee 61, Employed - <i>Create</i>
</h4>
<table border="0" width="100%">
<th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
<tr>
<td>Price</td><td></td><td>India/MT</td>
</tr>
</table>
<br>
<h4>Employee 61, Employed Term 1, Fixed Employed - <i>Create</i>
</h4>
<table border="0" width="100%">
<th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
<tr>
<td>Alternative</td><td></td><td>Asia</td>
</tr>
<tr>
<td>Price </td><td></td><td>123</td>
</tr>
<tr>
<td>Unit </td><td></td><td>India/MT</td>
</tr>
<tr>
<td>Floor</td><td></td><td>MARblE</td>
</tr>
<tr>
<td>Remainder</td><td></td><td>Asia</td>
</tr>
<tr>
<td>Rating</td><td></td><td>Return: amount = 55 uom = HH</td>
</tr>
</table>
<br>
<h4>Employee 61, Employed Term 2, Fixed Employed - <i>Create</i>
</h4>
<table border="0" width="100%">
<th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
<tr>
<td>Price </td><td></td><td>123</td>
</tr>
<tr>
<td>Unit </td><td></td><td>India/MT</td>
</tr>
<tr>
<td>Floor</td><td></td><td>MARblE</td>
</tr>
<tr>
<td>Rating</td><td></td><td>Quantity: amount = 45 uom = MT</td>
</tr>
</table>
<br>
<h4>Employee 61, Demurrage - <i>Create</i>
</h4>
<table border="0" width="100%">
<th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
<tr>
<td>Country</td><td></td><td>Africa</td>
</tr>
<tr>
<td>Term Period</td><td></td><td>2 months</td>
</tr>
<tr>
<td>Time Period</td><td></td><td>Asia</td>
</tr>
<tr>
<td>Flag ON/OFF</td><td></td><td>Asia</td>
</tr>
</table>
<br>
<h4>Employee 61, Organisation Job Settlement Term - <i>Create</i>
</h4>
<table border="0" width="100%">
<th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
<tr>
<td>Indicator</td><td></td><td>aaaaa</td>
</tr>
<tr>
<td>Alt Event</td><td></td><td>blSPLIT</td>
</tr>
<tr>
<td>Alt Osssssssssssssst</td><td></td><td>2</td>
</tr>
<tr>
<td>Calendar</td><td></td><td>NEW YORK</td>
</tr>
<tr>
<td>Currency Type</td><td></td><td>India</td>
</tr>
<tr>
<td>Day</td><td></td><td>aaaaa</td>
</tr>
<tr>
<td>Event</td><td></td><td>bl</td>
</tr>
<tr>
<td>alter ddddddddd</td><td></td><td>Asia</td>
</tScreen_Name_09, You can post in the bug database.
http://bugs.sun.com/bugdatabase/ -
Memory leak while debugging but not in release version
I have an Adobe AIR application that must load and unload multiple external swfs, and it must run for hours.
I had an issue where there was a memory leak. I tried all kinds of fixes, including rolling back SDKs and Adobe Runtime,
but every time I tested in Flashbuilder, the memory would climb, and with each unload a FlexLoader would stay in memory.
Finally I tried creating a release build, and low and behold the memory did not climb. It stayed the same even under stress testing.
So evidently, the memory leak had to do with debug version, and once it was a release version, the leak disappeared.UPDATE: The problem was with the external swfs being loaded into the main application.
If I compiled them in debug, they leaked. In release version they did not. -
How do you ensure that AIR on iOS does not leak memory and how do you trace 'leak' alerts to their source? Below is a table with a bunch of leak data, but I don't see how you could trace it back to your code and find the leak. I have tried making sure variables are de-referenced when finished with them, and event listeners are either removed or weak-referenced(allows objects to be garbage collected when the listener is the last thing referencing them).
I would like to get any and all leaks out of my app so that I can submit it to the App Store.
Edit: The leak table is from what it showed in the Apple 'Instruments' tool on my Mac when scanning the app running on my phone.
Edit 2: I'm not sure how to interpret this leak data from Instruments. My app is running within the 'captive' AIR runtime on the iPhone, so theoretically I would think that any leaks in my app would stay allocated in the AIR captive runtime and not show up here. I thought maybe I should be monitoring the 'Allocations' section of the tool for notable changes in the total allocations since un-garbage-collected stuff would stay contained within AIR. If it is showing leak data in the 'leaks' section, does that mean the AIR runtime itself is leaking? None of the functions or libraries or identifiers or whatever they are listed in the leak data match stuff that I wrote, so maybe they are parts of the 'AIR engine'.
Leaked Object
Address
Size
Responsible Library
Responsible Frame
NSCFString
60
< multiple >
960
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x154a73f0
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x154a73f0
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x154a73f0
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x1549ee40
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x1549ee40
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x1549ee40
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x1549ee40
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x1549ee40
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x1549ee30
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x1549ee30
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x1549ee30
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x1549ee30
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x1549ee30
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x1549d980
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x1549d980
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x1549d980
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x1549d980
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x1549d980
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x1549d6d0
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x1549d6d0
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x1549d6d0
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x1549d6d0
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x1548b800
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x1548b800
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x1548b800
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x1548b800
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x1548b070
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x1548b070
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x1548b070
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x1548b070
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x1548b070
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x154810f0
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x154810f0
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x154810f0
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x154810f0
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x154810f0
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x154810f0
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x1547ccd0
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x1544dfd0
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x1544dfd0
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x11637340
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x11637330
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x11637330
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x11637330
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x11626520
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x11626520
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x11626520
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x11626520
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x11615610
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x11615610
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0x11615610
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0xda84d0
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0xda84c0
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0xda84c0
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0xd905c0
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0xd7a150
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0xd67920
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0xd67920
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0xd67920
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
NSCFString
0xd31670
16
QuartzCore
CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)
GeneralBlock-16
4
< multiple >
64
libGLProgrammability.dylib
std::vector<TSymbolTableLevel*, std::allocator<TSymbolTableLevel*> >::_M_insert_aux(__gnu_cxx::__normal_iterator<TSymbolTableLevel**, std::vector<TSymbolTableLevel*, std::allocator<TSymbolTableLevel*> > >, TSymbolTableLevel* const&)
GeneralBlock-16
0x1160c700
16
libGLProgrammability.dylib
std::vector<TSymbolTableLevel*, std::allocator<TSymbolTableLevel*> >::_M_insert_aux(__gnu_cxx::__normal_iterator<TSymbolTableLevel**, std::vector<TSymbolTableLevel*, std::allocator<TSymbolTableLevel*> > >, TSymbolTableLevel* const&)
GeneralBlock-16
0x1160c700
16
libGLProgrammability.dylib
std::vector<TSymbolTableLevel*, std::allocator<TSymbolTableLevel*> >::_M_insert_aux(__gnu_cxx::__normal_iterator<TSymbolTableLevel**, std::vector<TSymbolTableLevel*, std::allocator<TSymbolTableLevel*> > >, TSymbolTableLevel* const&)
GeneralBlock-16
0x1160c700
16
libGLProgrammability.dylib
std::vector<TSymbolTableLevel*, std::allocator<TSymbolTableLevel*> >::_M_insert_aux(__gnu_cxx::__normal_iterator<TSymbolTableLevel**, std::vector<TSymbolTableLevel*, std::allocator<TSymbolTableLevel*> > >, TSymbolTableLevel* const&)
GeneralBlock-16
0x1160c700
16
libGLProgrammability.dylib
std::vector<TSymbolTableLevel*, std::allocator<TSymbolTableLevel*> >::_M_insert_aux(__gnu_cxx::__normal_iterator<TSymbolTableLevel**, std::vector<TSymbolTableLevel*, std::allocator<TSymbolTableLevel*> > >, TSymbolTableLevel* const&)
GeneralBlock-16
3
< multiple >
48
libGLProgrammability.dylib
GetSymbolTable(int)
GeneralBlock-16
0xd638f0
16
libGLProgrammability.dylib
GetSymbolTable(int)
GeneralBlock-16
0xd638f0
16
libGLProgrammability.dylib
GetSymbolTable(int)
GeneralBlock-16
0xd638f0
16
libGLProgrammability.dylib
GetSymbolTable(int)
GeneralBlock-16
0xd8dca0
16
libGLProgrammability.dylib
std::vector<TSymbolTableLevel*, std::allocator<TSymbolTableLevel*> >::_M_insert_aux(__gnu_cxx::__normal_iterator<TSymbolTableLevel**, std::vector<TSymbolTableLevel*, std::allocator<TSymbolTableLevel*> > >, TSymbolTableLevel* const&)As I said in the post, the stuff reported in leaks doesn't match any of my variable or function names. It just shows generic stuff for the 'Responsible Library/Frame', such as GetSymbolTable(int) or QuartzCore. I didn't name anything in my code by those names. Quartz, I believe, is the stuff used to draw vectors on iOS, and the other things like 'TSymbolTableLevel' are not names I used either.
So I am not sure if this is my code leaking memory or the AIR rumtime itself leaking memory, or how you would go about interpreting Instruments reports on an AIR based app. My theory is that any stuff not garbage collected and leaked within the AIR runtime should be contained within the runtime wouldn't show up in Instruments as a leak, so I don't know if there is anything I can do within my code to make the 'leaks' dissappear or not.
There is a ton of stuff going on in my code, events and functions calling or initiating other functions and such, so it isnt as simple as just looking at what code would be fired at the time the leak shows up to figure out what piece of code the leak occured at. -
JBoss EAP 6 On JRockit - Memory Leak
hello team.
I have memory leak problem on jboss and jrockit.
My Environment :
1. OS :
CentOS release 6.4 (Final)
2. JRockit :
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Oracle JRockit(R) (build R28.2.7-7-155314-1.6.0_45-20130329-0641-linux-x86_64, compiled mode)
3. Application Server:
JBoss EAP 6.2.0.GA
4. Application
Large EJB Application (100 and more EJB Beans (Stateless, Stateful, MDB, Timers and so on)
Everything works fine on older application server versions (4.3 , 4.2)
But now I have Problem
Of course I know that problem is new version - and i have discussion on JBoss forums.
but guys I have question about jrockit with you:
What is the option "Other" in memory ??
[jboss@jboss-new bin]$ jrcmd 17114 print_memusage
17114:
Total mapped 8457864KB (reserved=2983100KB)
- Java heap 3145728KB (reserved=0KB)
- GC tables 105232KB
- Thread stacks 46412KB (#threads=138)
- Compiled code 1048576KB (used=12257KB)
- Internal 1480KB
- OS 170324KB
- Other 3639056KB
- Classblocks 10496KB (malloced=9631KB #28393)
- Java class data 289536KB (malloced=192391KB #133697 in 28393 classes)
- Native memory tracking 1024KB (malloced=294KB #10)
[jboss@jboss-new bin]$
This size increases every time - and took entire amount of RAM.
Thank in Advance.
Regards,
Paata LominadzeNot sure what the 'other' is, but it is probably best shown by using an example. By using displayMap we can display a memory map of various JVM subsystems and libraries that are loaded, including third-party libraries.
./jrcmd 4523 print_memusage displayMap
Total mapped 3984796KB (reserved=2978740KB)
- Java heap 524288KB (reserved=0KB)
- GC tables 17548KB
- Thread stacks 20276KB (#threads=39)
- Compiled code 1048576KB (used=14224KB)
- Internal 1672KB
- OS 146924KB
- Other 2092648KB
- Classblocks 7424KB (malloced=7381KB #20064)
- Java class data 124416KB (malloced=124411KB #91048 in 20064 classes)
- Native memory tracking 1024KB (malloced=118KB #10)
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
OS *java r x 0x0000000000400000.( 76KB)
OS *java rw 0x0000000000612000.( 4KB)
OS *[heap] rw 0x00000000007c1000.( 132KB)
INT Poll r 0x000000007fffe000 ( 4KB)
INT Membar rw 0x000000007ffff000.( 4KB)
MSP Classblocks (1/2) rw 0x00000000df8c0000 ( 6912KB)
MSP Classblocks (2/2) rw 0x00000000dff80000 ( 512KB)
HEAP Java heap rw 0x00000000e0000000.( 524288KB)
OS *ld-2.12.so r x 0x0000003664400000.( 128KB)
OS *ld-2.12.so r 0x000000366461f000 ( 4KB)
OS *ld-2.12.so rw 0x0000003664620000 ( 4KB)
OS **ld-2.12.so rw 0x0000003664621000.( 4KB)
OS *gconv-modules.cache r 0x00007f8f2e4a0000 ( 28KB)
THREAD Stack 4630 rwx 0x00007f8f2e4a7000 ( 8KB)
THREAD Stack 4630 0x00007f8f2e4a9000 ( 12KB)
THREAD Stack 4630 rwx 0x00007f8f2e4ac000 ( 244KB)
MSP Java class data (5/37) rw 0x00007f8f2e4e9000 ( 14336KB)
MSP Java class data (9/37) rw 0x00007f8f2fa40000 ( 5888KB)
rw 0x00007f8f30000000 ( 188KB)
0x00007f8f3002f000 ( 65348KB)
rw 0x00007f8f34000000 ( 132KB)
0x00007f8f34021000 ( 65404KB)
rw 0x00007f8f38000000 ( 412KB)
0x00007f8f38067000.( 65124KB)
MSP Java class data (10/37) rw 0x00007f8f3c034000 ( 34048KB)
rw 0x00007f8f3e174000 ( 8200KB)
MSP Java class data (11/37) rw 0x00007f8f3e976000 ( 256KB)
OS *libhpi.so rw 0x00007f8fb37fc000 ( 8KB)
OS **libhpi.so rw 0x00007f8fb37fe000 ( 4KB)
CODE Compiled code rwx 0x00007f8fb37ff000 ( 64KB)
CODE Compiled code rwx 0x00007f8fb380f000 ( 128KB)
CODE Compiled code rwx 0x00007f8fb382f000 ( 64KB)
MSP Java class data (37/37) rw 0x00007f8ff83a1000 ( 512KB)
GC Modified Union Set (committed) rw 0x00007f8ff8421000 ( 132KB)
GC Card table rw 0x00007f8ff8442000 ( 1024KB)
GC Object bits (committed) rw 0x00007f8ff8542000 ( 8196KB)
Here
- thread is thread related (such as thread stacks)
- int, internal use (such as pointer pages)
- heap, chunk used by JRockit for the Java heap
- os, mapped directly from the operating system, such as third party DLLs or shared objects
- msp, memory space. a memory space is a native heap with a specific purpose, for example native memory allocation inside the JVM
- gc, garbage collection related, for example live bits
- code, compiled code
The 'other' memory space looks to me (from the blank entries in the above print-out) like they are a memory pages to are still not used. When the JVM starts it mappes an amount of memory. To my knowledge JRockit uses mmap (mmap(2) - Linux manual page), which creates a new mapping in the virtual address space. JRockit reserves an amount of memory (Java Heap (heap where your object instances go) + its own runtime (all the others)).
To see where the growth is in the various memory spaces, you can use 'print_memusage baseline', after which you can execute print_memusage again, for example,
./jrcmd 4523 print_memusage scale=M
4523:
Total mapped 3896MB +4MB (reserved=2905MB -3MB)
- Java heap 512MB (reserved=0MB)
- GC tables 17MB
- Thread stacks 19MB (#threads=39)
- Compiled code 1024MB (used=14MB +1MB)
- Internal 1MB
- OS 143MB
- Other 2043MB
- Classblocks 7MB (malloced=7MB #20596 +532)
- Java class data 126MB +4MB (malloced=125MB +4MB #93640 +2592 in 20596 classes)
- Native memory tracking 1MB (malloced=0MB #20 +10)
Note the additional column that prints out the difference in memory usage in relation to the baseline. You can also monitor native allocations by using trace_alloc_sites, memory allocations can then be displayed with different levels of detail using the level argument.
./jrcmd 4523 print_memusage trace_alloc_sites=true
4523:
Total mapped 3989660KB +4864KB (reserved=2974732KB -4008KB)
- Java heap 524288KB (reserved=0KB)
- GC tables 17548KB
- Thread stacks 20276KB (#threads=39)
- Compiled code 1048576KB (used=15265KB +1040KB)
- Internal 1672KB
- OS 146924KB
- Other 2092648KB
- Classblocks 7680KB +256KB (malloced=7669KB +287KB #20596 +532)
- Java class data 129024KB +4608KB (malloced=128967KB +4555KB #93640 +2592 in 20596 classes)
- Native memory tracking 1024KB (malloced=236KB +118KB #20 +10)
./jrcmd 4523 print_memusage level=3
4523:
Total mapped 3989660KB +4864KB (reserved=2974732KB -4008KB)
- Java heap 524288KB (reserved=0KB)
- GC tables 17548KB
- Thread stacks 20276KB (#threads=39)
- Compiled code 1048576KB (used=15265KB +1040KB)
- Internal 1672KB
- OS 146924KB
- Other 2092648KB
- Classblocks 7680KB +256KB (malloced=2KB -7379KB #4 -20060) Not fully traced
- Java class data 129024KB +4608KB (malloced=26KB -124385KB #16 -91032 in 20596 classes) Not fully traced.
- Native memory tracking 1024KB (malloced=118KB #10) Not fully traced.
gather_memorymap_database memtrace.c: 206 91KB +91KB (#1 +1)
gather_memory_usage osal_mspace.c:5142 7KB +7KB (#4 +4)
msGatherMSpacesUsageDatabase osal_mspace.c:6128 2KB +2KB (#1 +1)
msGatherMSpacesUsageDatabase osal_mspace.c:6134 16KB +16KB (#1 +1)
Note this is more on the JVM level, in your case in might be beneficial to investigate what is happening on the java heap. By using print_object_summary you can get insight how memory on the heap is used on a per-class basis. To get to the bottom of where the memory leak is you can use the memory-leak-detector (an example of its use can be found here Middleware Snippets: Fast, Faster, JRockit). You can also obtain a heapdump that can be analyzed by using for example MAT (see for an example here Middleware Snippets: Visualizing Class Loading). To obtain a heapdump you can run the command, for example,
[weblogic@machine1 bin]$ ./jrcmd 4523 runsystemgc full=true fullcompact=true
4523:
[weblogic@machine1 bin]$ ./jrcmd 4523 hprofdump filename=/home/weblogic/dump.hprof
4523:
Wrote dump to /home/weblogic/dump.hprof
Note that this first issues a full GC by using the runsystemgc command. -
Memory Leak in Report after upgrading from Crystal Reports 10.5 to 13.0.1/2
I'm currently having an issue with crystal reports 13 (Visual Studio 2010), We have recently updated our CRM Solution to use the newer crystal reports runtime as we are now using Visual Studio 2010,
We have a client who has a report which contains a sub report which basically contains a Image pulled from a MSSQL Database as a BLOB Image Field which is basically scanned images relating to the report, Previously the report worked fine before the Client Updated our CRM Solution to the latest version, Now for each individual page which has the scanned image the application is swallowing 100 MB of ram, as there are around 32 of these scanned images and our solution is a 32 bit application we are getting out of memory errors due to the whole 2GB addressable to a 32 bit process limitation,
The images are around 4MP and stored in JPG format in the database so should not be consuming over 100mb of ram per image displayed by the report even if they are being stored uncompressed in RGBA Format,
Likewise when viewing the pages of the report manually after a specific page (when the amount of memory addressable by a 32 bit application gets hit) the images just don't display and then any pages with the image are not being displayed and not giving an error / exception.
I have tried re-saving the .rpt files to cause them to be in the newer crystal reports format and this is still happening, likewise I have tried un-installing the 13.0.1 and installing the 13.0.2 runtime.
I am just about to check SQL which pulls the image for the sub report, although I am sure for each sub report it should only be pulling one row with one jpeg image in case the sub report is holding quite a few images but only displaying the first.
Likewise If all else fails I will try re-creating the report as I have experienced issues with some other specific reports doing strange things after being updated from the 2008 runtime which I really am not liking the idea of due to how fiddly crystal reports can be, It is good and does the job but takes far longer than some other solutions to get what you are trying to achieve done.
This report had been working fine for 2+ years before the client updated to the most recent version of our CRM Software.
Has anyone else experienced simular issues with the latest runtime.I have just been reviewing the code for this and it appears that the sub report is pulling all of the images,
It is strange that previously this was working fine seems like the newer runtime does not dispose of the data once it has been displayed on a sub report which would explain memory leak as it will call the select again pulling approx 60 images which are probably approx 8 - 900KB plus sub report + uncompressed image to display and then filtering.
I am about to modify this report and will post if fix i put in place resolves the issue.
Maybe you are looking for
-
ITunes will only open in 64 Bit Mode from Dock since Restore
I have only ONE big problem since doing a restore from my Time Machine backup-up for for Late 2009 iMac 27". For some reason I can only get iTunes to open in 64 bit mode if I put an icon on the dock???? It opens in 32 bit mode which is selected in
-
Safari not printing from hotmail
I am running Mac OS 10.5.5 with Safari. Since hotmail has done their recent site upgrade I can no longer print my emails with Safari. The preview comes up blank and when you print it is blank. I have re - installed the latest drivers and have done al
-
Hi, When i copy a selection screen from a existing program to re use it, the screen copied has normal screen as its screen type and iam unable to change the attribute since selection screen option is disabled.And also when i try to create a new scr
-
Configuration Network access on 10.4.11
Access to the Network has been blocked since I upgraded to 10.4.11 (on both iMac and PowerBook) Whn opened, the tools keeps popping a window with "Newtwork settings changed by another app" and the Conf tool in the menu bar dosn't work. I must use the
-
Hello, I have an Access 2007 application, the front end for an Oracle 11g R2 database (latest patch, 11.2.0.2). Using client ODAC 11.2 Release 3 (11.2.0.2.1) - latest. The error is related to adding/deleting records from a linked table. Here are the