Page 1 of 1

Out of Memory

Posted: 07 Nov 2013, 19:21
by Luis
Hi,

I have a problem with a multiple load of CAD files with CAImportNet.dll

I load some CAD files in my application.

At the loading of one of these, the system goes into exception of "out of memory" but the physical memory is available.

Is there a limit in the use of libraries?

Thanks.

Re: Out of Memory

Posted: 08 Nov 2013, 11:14
by support
Hello!

Could you send the file that raises "Out of Memory" exception to the Technical Support e-mail: support@cadsofttools.com?


Mikhail.

Re: Out of Memory

Posted: 08 Nov 2013, 13:14
by Luis
Hello,
thanks for your answer.

I cannot sent you the file because it is a confidential file of my customer, but the problem is replicable when you try to upload 6 files each of 10 MB.

I have continued to investigate the problem and I noticed that it occurs primarily when I try to save the various entities of the CAD file in an hashtable.

Can you help me?

thanks.

Luis

Re: Out of Memory

Posted: 11 Nov 2013, 18:05
by Luis
Hello,

to avoid the problem illustrated in the previous post, I decided to create file dwg with xref.

Can I upload and make visible the xref from a code after mouse events?

Thanks,

Luis

Re: Out of Memory

Posted: 13 Nov 2013, 12:20
by Luis
Hello,

I can dispose the XRef by mouse events, but I can not load an xref and make it visible from the code.

Can you show me an example?

Thanks,

Luis

Re: Out of Memory

Posted: 15 Nov 2013, 13:06
by support
Hello,

The example below demonstrates how to add an XRef to the previously created CADImage and draw it to the PictureBox:

Code: Select all

CADImage cadImage;
Graphics gr;
RectangleF rect;
...

gr = pictureBox1.CreateGraphics();
rect = new RectangleF(0, 0, pictureBox1.Width, pictureBox1.Height);
...

private void addXRef(string filePath)
{
   CADImage xRef = CADImage.CreateImageByExtension(filePath);
   xRef.LoadFromFile(filePath);
   DPoint pos = new DPoint(500, 500, 0);
   DPoint scale = new DPoint(1, 1, 1);
   cadImage.AddScaledDXFEx(xRef, filePath, pos, scale, 0);
}
...

addXRef("d:\\drawing.dwg");
cadImage.Draw(gr, rect);
Mikhail.

Re: Out of Memory

Posted: 20 Nov 2013, 13:10
by Luis
Thanks for your help.

Luis

Re: Out of Memory

Posted: 26 Nov 2013, 15:48
by Luis
Hello Mikhail,

I use your code in this and others post to add or dispose xRef in my CADImage.

I have the following problem: when I dispose added XRef, the system does not release the memory occupied by the same xref. How can I solve this problem?

Thanks,

Luis

Re: Out of Memory

Posted: 29 Nov 2013, 17:18
by support
Hello Luis,

You can find answer about releasing memory here.


Mikhail.