Solved

Allocate memory for a component

Posted on 2010-11-27
5
394 Views
Last Modified: 2012-05-10
First, im not sure if this is a generic question or not. I'm using DevArts component "tVitualTable" a table that exist only in memory. If i add 10 000 rows - it takes less than a second, but if i add 100 000 records, it takes about one minute. Im quite sure this has to do with memory allocation, but can i affect this?
0
Comment
Question by:Sunsales
5 Comments
 
LVL 24

Expert Comment

by:jimyX
Comment Utility
The memory allocation is already done by the component itself and nothing is required from you to help it out.
How do you generate those records, it could be overhead.
Try to duplicate those 10 000 records on memory to make sure it's not memory allocation.
0
 
LVL 14

Expert Comment

by:systan
Comment Utility
I'm sure the problem is in your loop statement, try to trace each line you have while loading the table
0
 
LVL 32

Accepted Solution

by:
ewangoya earned 500 total points
Comment Utility
Make sure you call DisableControls and EnableControls.
Dont use FieldByName if you are loading many records, use field index or get pointers to the fields first

procedure TForm1.LoadRecords;
var
  F1: TField;
begin
  F1 := VirtualTable.FieldByName('Field1');
 
  VirtualTable.DisableConrols;
  for I := 0 to LoadCount do
  begin
      VirtualTable.Append;
      FI.AsString := '';
      //or
      VirtualTable.Fields[0].AsString := '';
      VirtualTable.Post;
  end;
  VirtualTable.EnableControls;
end;

Secondly,you dont have to load all the records at once, You can load 10,000 records at a time each time the user scrolls to the last record until you have loaded all records
0
 
LVL 3

Expert Comment

by:gskoczylas
Comment Utility
Perhaps you don't have enough RAM in your computer. If running applications require to much memory Windows is solving this problem by heavy using of virtual memory (intensively using swap file). In such conditions performance of the whole system drastically decreasing.
0
 

Author Comment

by:Sunsales
Comment Utility
i got 12 GB ram
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now