In one of my SSIS package giving error during the execution time. Package contains two script task which will run in parallel. From script task what I'm doing is that, getting some svg files from a shared location and read it and then convert it to xaml and png files. Inside script task there are two loops. One loop is to iterate the svg files from the folder. Second loop is for each svg files will be multiple root elements which are related to some assembly information. So iterating through these root elements will create individual xaml files for each one. In one svg file at least 5 or more components will be there.
This is working fine for limited files around 20 or 25. But when increase the count to 100 or 150 that time I'm getting error like "Not enough memory resources to perform this command". When I look in the memory and resource governor there is no any memory hits.
Could some one help what else I'm need to look to figure out the issue.
public void UploadPng(string svgPath, string svgFileName)
{
//var outputFile = XDocument.Load(svgPath);
string pngPath = Dts.Variables["PNGFolder"].Value.ToString() + @"\snapshot_" + svgFileName.Replace("svg","png");
var htmlToImageConv = new NReco.ImageGenerator.HtmlToImageConverter
{
Width = 600,
Height = 400
};
var jpegBytes = htmlToImageConv.GenerateImageFromFile(svgPath, ImageFormat.Png); //htmlToImageConv.GenerateImage(html, ImageFormat.Png);
using (var stream = new MemoryStream(jpegBytes, 0, jpegBytes.Length))
{
Bitmap bm = new Bitmap(Image.FromStream(stream));
bm.Save(pngPath, System.Drawing.Imaging.ImageFormat.Png);
stream.Dispose();
stream.Close();
}
}
// For xaml writing
public void UploadXAMLFile(SVgComponent Component)
{
using (var fileStream = new MemoryStream(System.Text.Encoding.ASCII.GetBytes(cnt + Component.xaml.ToString())))
{
filesize = Convert.ToString(fileStream.Length);
var FileTransfer = new TransferUtility(new AmazonS3Client(_accessKey, _secretKey, _bucketRegion));
FileTransfer.Upload(fileStream, path + Component.svgName, Component.FileName.Replace("svg", "xaml").ToLower());
fileStream.Dispose();
fileStream.Close();
}
}