Recent Posts
November 2013
« Oct    

Posts Tagged ‘stack’

iTextSharp – HTML to PDF – Writing the PDF


Last week we parsed the HTML and created code that keeps track of the various attributes we are going to need when we create the PDF.  Today we will finish the code and create the Elements that we can include in our PDF document.

One consideration we will need to keep in mind as we write out the PDF is that we have pushed various font characteristics that may overlap onto our stack.

Read the rest of this entry »

Initializing An Array inline

arct-075 This is part two of the discussion I started yesterday about the StackOverflowException, where I explained how memory gets allocated for the different types of variables we have in our systems and how understanding that can prevent the StackOverflowException.  The question came back with some code this time which looked something like this:

private mystruct[] m_struct = 
    new mystruct[6000000];
private mystruct[] GetStructArray()
    m_struct[0] = 
        new mystruct(3, 2);
    m_struct[5900000] = 
        new mystruct(5,4);
struct mystruct
    public mystruct(int i,int j)
        m_i = i;
        m_j = j;
    public int m_i;
    public int m_j;

Read the rest of this entry »

StackOverflowException – What causes this?

ka_vol1_064 Oner Yilmaz Asks:

I am using C# Êxpress developer tool. I Intend to form 3D Mesh object by an array of 60.000 items. When I reach to appr. 19.000 items, I get the error message "An unhandled exception of type ‘System.StackOverflowException’ occurred in Test.exe"
My PC has 2GB RAM.
As for you, what is the reason ?

Read the rest of this entry »