English 中文(简体)
视觉基本记忆的使用不断扩大
原标题:Visual Basic memory usage keeps expanding

记忆量在不断上升和扩展,直到没有记忆。 I m 采用GHeat.Net plugin to building pornography。 这里的全文是:

Dim pm As New gheat.PointManager()
Dim g As Graphics

Dim startZoom As Integer = 2
Dim maxZoom As Integer = 17

gheat.Settings.BaseDirectory = "C:\gheatWeb\__\etc\"

pm.LoadPointsFromFile("C:\points.txt")

For zoom As Integer = startZoom To maxZoom
    Dim startX As Integer = 0
    Dim startY As Integer = 0
    Dim maxX As Integer = 2 ^ zoom
    Dim maxY As Integer = 2 ^ zoom

    For x As Integer = startX To maxX
        For y As Integer = startY To maxY
            Dim filename As String = "C:\images\" + zoom.ToString + "\x" + x.ToString + "y" + y.ToString + "zoom" + zoom.ToString + ".gif"
            gheat.GHeat.GetTile(pm, "classic", zoom, x, y).Save(filename, System.Drawing.Imaging.ImageFormat.Gif)
        Next
    Next
Next

由于某种原因,当我打上<<>><<>>>>><>>>>路程时,使用的记忆量刚刚增加,直到达到上限。 即便如此,方案仍然运作,但记忆却未补。 该方案在20Mb处产生罚款,因此,我无法说明为什么它只是继续实施。

我也尝试了<代码>GC.Collect,在最晚的休息期结束时没有结果。 任何想法?

最佳回答

GHeat.GetTile returns a Bitmap which must be disposed.
Also, there s no need to escape paths like that in VB.

For x As Integer = startX To maxX
  For y As Integer = startY To maxY
    Dim filename As String = String.Format("C:images{0}x{1}y{2}zoom{3}.gif", zoom, x, y, zoom)
    Using img = gheat.GHeat.GetTile(pm, "classic", zoom, x, y)
      img.Save(filename, System.Drawing.Imaging.ImageFormat.Gif)
    End Using
  Next
Next
问题回答

暂无回答




相关问题
Is Shared ReadOnly lazyloaded?

I was wondering when I write Shared ReadOnly Variable As DataType = New DataType() Or alternatively Shared ReadOnly Variable As New DataType() Is it lazy loaded or as the instance initializes? ...

Entertaining a baby with VB.NET

I would like to write a little application in VB.NET that will detect a baby s cry. How would I get started with such an application?

Choose Enter Rather than Pressing Ok button

I have many fields in the page and the last field is a dropdown with list of values. When I select an item in a dropdown and press Enter, it doesn t do the "Ok". Instead I have to manually click on Ok ...

ALT Key Shortcuts Hidden

I am using VS2008 and creating forms. By default, the underscore of the character in a textbox when using an ampersand is not shown when I run the application. ex. "&Goto Here" is not ...

Set Select command in code

On button Click I want to Set the Select command of a Gridview. I do this and then databind the grid but it doesn t work. What am i doing wrong? protected void bttnView_Click(object sender, ...

Hover tooltip on specific words in rich text box?

I m trying to create something like a tooltip suddenly hoovering over the mouse pointer when specific words in the richt text box is hovered over. How can this be done?

热门标签