Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
S

Skippy II

@Skippy II
About
Posts
6
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Weird memory problem
    S Skippy II

    I understand your reaction. Perhaps it is indeed a wrong approach. But the problem is much bigger than the provided code. Actually the whole project is about creating a very fast virtual grid (a bit comparable to a virtual listview, but even a lot faster). Accessing an object array (with property values at a specific location) is way faster than accessing the regular properties. The first coding steps led to a very fast, but extremely complex way of programming (a combination of virtual and real cells in the grid). One solution is to extend the object array so every cell can be virtual. But then this OutOfMemoryException came up... Anyway, thanks for your contribution. Skippy II

    Visual Basic algorithms performance help question

  • Weird memory problem
    S Skippy II

    Thanks for replying, Luc. That is indeed very true. I completely overlooked this . Do you know if there is a way to increase the available memory allocation? Skippy II

    Visual Basic algorithms performance help question

  • Weird memory problem
    S Skippy II

    I cannot deny what you write. You're absolutely right. The idea may not be the best. But you still do not answer the questions. Why is an error thrown when declaring an array that might hold 125,000,000 objects, but not when declaring 10 times an array of 120,000,000 items? Skippy II

    Visual Basic algorithms performance help question

  • Weird memory problem
    S Skippy II

    Thanks for your reaction. I know it doesn't make much sense to create such big arrays. At least not 10 of them. But I would like to use the idea in a grid control. The array would contain columnnumbers, rownumbers and cell properties. Now the code provided is just an example and is not the whole project of course. It is only a simple way to explain the problem. In fact, what I wanted to show, is that when allocating memory for 125,000,000 objects an error is thrown. But when allocating memory for 10 times 120,000,000 objects, no error is thrown at all. I hope your "better" question is answered. :) Any idea about my questions? Skippy II

    Visual Basic algorithms performance help question

  • Weird memory problem
    S Skippy II

    Hi all, I have 2 forms (Form1 and Form2) in my app. Form1 has 2 buttons (Button1 and Button2). The Load event of Form2 has this code: Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim obj(,,) As Object ReDim obj(50, 24000, 100) End Sub When you click Button1 on Form1 this code is executed: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim obj(,,) As Object ReDim obj(50, 25000, 100) End Sub The ReDim statement gives an OutOfMemoryException. When I change the statement to ReDim obj(50, 24000, 100) the exception isn't thrown anymore. When Button2 is clicked, this code is executed: Private Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click For tel As Integer = 1 To 10 Dim f As New Form2 f.Show() Next End Sub This works just fine. After searching the web for answers, I think it may have to do with the heap size, but I'm not sure at all. My questions: Why is the Button1 code giving an exception and why is this not happening when clicking Button2? What should I do to make the Button1 code work without throwing an exception? Skippy II

    Visual Basic algorithms performance help question

  • How to get the line number
    S Skippy II

    Use the Erl function. But in order to get it work, you need to number your lines of code. A very useful tool is MZTools, which can do that and a lot of other very interesting stuff. (http://www.mztools.com/)

    Visual Basic question help tutorial
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups