Out of Memory

Discuss and ask questions about CAD .NET library.

Moderators: SDS, support, admin

Post Reply
Luis
Posts: 10
Joined: 25 Oct 2013, 16:40

Out of Memory

Post by Luis » 07 Nov 2013, 19:21

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.

support
Posts: 3272
Joined: 30 Mar 2005, 11:36
Contact:

Re: Out of Memory

Post by support » 08 Nov 2013, 11:14

Hello!

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


Mikhail.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Luis
Posts: 10
Joined: 25 Oct 2013, 16:40

Re: Out of Memory

Post by Luis » 08 Nov 2013, 13:14

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

Luis
Posts: 10
Joined: 25 Oct 2013, 16:40

Re: Out of Memory

Post by Luis » 11 Nov 2013, 18:05

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

Luis
Posts: 10
Joined: 25 Oct 2013, 16:40

Re: Out of Memory

Post by Luis » 13 Nov 2013, 12:20

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

support
Posts: 3272
Joined: 30 Mar 2005, 11:36
Contact:

Re: Out of Memory

Post by support » 15 Nov 2013, 13:06

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.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Luis
Posts: 10
Joined: 25 Oct 2013, 16:40

Re: Out of Memory

Post by Luis » 20 Nov 2013, 13:10

Thanks for your help.

Luis

Luis
Posts: 10
Joined: 25 Oct 2013, 16:40

Re: Out of Memory

Post by Luis » 26 Nov 2013, 15:48

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

support
Posts: 3272
Joined: 30 Mar 2005, 11:36
Contact:

Re: Out of Memory

Post by support » 29 Nov 2013, 17:18

Hello Luis,

You can find answer about releasing memory here.


Mikhail.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Post Reply