我正在Delphi Rio 10.3社区中开发一个项目,目前有24个单元。我遇到的这种特殊形式包含28个相同类型的框架,每个框架都包含一个TChart组件,其中带有一些按钮和复选框(打印图表,显示/隐藏系列/标签等)。一切都很好,直到大约20-25帧/图,但是昨天我又增加了几个,直到达到28张/图。在设计和运行时都没有任何错误,所以我最终开心地关闭了Delphi。
下次启动Delphi时出现问题。当我简单地打开项目时,我遇到的确切错误是“错误创建表格:内存不足”。确认错误后,项目仍然可以正常打开,除了具有28帧/图表的特定DFM文件之外。我仍然可以毫无问题地编译和运行项目,但是我无法在IDE中可视化表单以进一步开发它。
我知道我遇到了某种限制,尽管项目/表格并不庞大。我有一个32GB内存的i7,Windows显示我有26GB的可用空间,所以我认为足够。
我在网上没有找到对此确切错误消息的任何引用,但是有一些类似的编译器错误,这不是我的情况:
http://docwiki.embarcadero.com/RADStudio/Rio/en/F2046_Out_of_memory_(Delphi)
但是,我确实尝试通过增加Windows中交换文件的大小来解决该问题,但是没有运气。
我还从Andy安装了最新的IDE Fix Pack 6.4.2,再次没有成功:
https://andy.jgknet.de/blog/ide-tools/ide-fix-pack/
DFM文件大约有3000行,因此仅粘贴28帧/图表中的一个:
inline FrameSmartChart1: TFrameSmartChart
Left = 50
Top = 800
Width = 450
Height = 250
TabOrder = 2
ExplicitLeft = 50
ExplicitTop = 800
inherited Chart1: TChart
Title.Text.Strings = (
'Incoming Calls From MSCs')
PrintMargins = (
15
22
15
22)
inherited Label0: TLabel
Width = 52
Hint = 'Voice-Charging-Originating-Call'
Caption = 'Originating'
ExplicitWidth = 52
end
inherited Label1: TLabel
Width = 52
Hint = 'Voice-Charging-Forwarding-Call'
Caption = 'Forwarded'
ExplicitWidth = 52
end
inherited Label2: TLabel
Width = 56
Hint = 'Voice-Charging-Terminating-Call'
Caption = 'Terminating'
ExplicitWidth = 56
end
inherited CheckBox2: TCheckBox
Hint = 'Voice-Charging-Terminating-Call'
end
inherited CheckBox1: TCheckBox
Hint = 'Voice-Charging-Forwarding-Call'
end
inherited CheckBox0: TCheckBox
Hint = 'Voice-Charging-Originating-Call'
end
inherited Series3: TBarSeries
BarStyle = bsRectangle
end
end
end
单位标题:
unit CCN;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls, ComCtrls, StdCtrls, NodeClasses, NSPmagazine, NSP,
OleCtrls, TSP, Linux, Services, SmartChart, DB,
ZAbstractRODataset, ZAbstractDataset, ZAbstractTable, ZDataset,
ZConnection, ZAbstractConnection;
type TCCN = class(TNode)
procedure GetConfig; override;
procedure GetStatus; override;
procedure GetCounters; override;
private
procedure PlotCountersDBRowToCharts(ZQuery: TZQuery);
end;
type
TFrameCCN = class(TFrame)
PageControl1: TPageControl;
TabSheet1: TTabSheet;
TabSheet2: TTabSheet;
TabSheet3: TTabSheet;
TabSheet4: TTabSheet;
Panel1: TPanel;
FrameNSP: TFrameNSP;
FrameTSP: TFrameTSP;
Label1: TLabel;
Edit1: TEdit;
FrameLinux: TFrameLinux;
Label2: TLabel;
RichEdit1: TRichEdit;
TabSheet5: TTabSheet;
Frame51: TFrame5;
PageControl2: TPageControl;
TabSheet6: TTabSheet;
TabSheet7: TTabSheet;
TabSheet8: TTabSheet;
TabSheet9: TTabSheet;
ZConnection1: TZConnection;
ZQueryCounters: TZQuery;
ZQueryCountersHistory: TZQuery;
ScrollBox1: TScrollBox;
DateTimePickerFirst: TDateTimePicker;
DateTimePickerLast: TDateTimePicker;
FrameSmartChart1: TFrameSmartChart;
FrameSmartChart2: TFrameSmartChart;
FrameSmartChart3: TFrameSmartChart;
FrameSmartChart4: TFrameSmartChart;
FrameSmartChart5: TFrameSmartChart;
FrameSmartChart6: TFrameSmartChart;
FrameSmartChart7: TFrameSmartChart;
FrameSmartChart8: TFrameSmartChart;
FrameSmartChart9: TFrameSmartChart;
FrameSmartChart10: TFrameSmartChart;
FrameSmartChart11: TFrameSmartChart;
Shape1: TShape;
Shape3: TShape;
Shape4: TShape;
Shape5: TShape;
Shape6: TShape;
Shape7: TShape;
FrameSmartChart12: TFrameSmartChart;
FrameSmartChart13: TFrameSmartChart;
Shape8: TShape;
Shape9: TShape;
Shape10: TShape;
Shape11: TShape;
Shape12: TShape;
Shape13: TShape;
Shape14: TShape;
Shape15: TShape;
Shape16: TShape;
Shape17: TShape;
Shape18: TShape;
Shape19: TShape;
Shape20: TShape;
Shape21: TShape;
Shape22: TShape;
Shape23: TShape;
Shape24: TShape;
Shape25: TShape;
Shape26: TShape;
Shape27: TShape;
Shape28: TShape;
FrameSmartChart14: TFrameSmartChart;
Shape29: TShape;
ScrollBox2: TScrollBox;
FrameSmartChart15: TFrameSmartChart;
FrameSmartChart16: TFrameSmartChart;
FrameSmartChart17: TFrameSmartChart;
FrameSmartChart18: TFrameSmartChart;
FrameSmartChart19: TFrameSmartChart;
FrameSmartChart20: TFrameSmartChart;
Shape2: TShape;
FrameSmartChart21: TFrameSmartChart;
FrameSmartChart22: TFrameSmartChart;
FrameSmartChart23: TFrameSmartChart;
FrameSmartChart24: TFrameSmartChart;
Shape30: TShape;
Shape31: TShape;
Shape32: TShape;
Shape33: TShape;
Shape34: TShape;
Shape35: TShape;
Shape36: TShape;
Shape37: TShape;
Shape38: TShape;
Shape39: TShape;
Shape40: TShape;
Shape41: TShape;
TabSheet10: TTabSheet;
ScrollBox3: TScrollBox;
FrameSmartChart25: TFrameSmartChart;
FrameSmartChart26: TFrameSmartChart;
Shape42: TShape;
Shape43: TShape;
FrameSmartChart27: TFrameSmartChart;
Shape44: TShape;
FrameSmartChart28: TFrameSmartChart;
Shape45: TShape;
private
{ Private declarations }
public
end;
implementation
{$R *.dfm}
uses SSH, NOCMagic, NSPprocessor, Log, DateUtils, SqlTimSt, DbChart, StrUtils,
InfoMessage, Series;
IDE进入IDE调试器时,在下面的行中出现内存不足错误,从而导致中断:
KERNELBASE.GetLastError:
75B445B0 64A118000000 mov eax, fs:[$00000018]
75B445B6 8B4034 mov eax,[eax+$34]
75B445B9 C3 ret
75B445BA CC int 3
75B445BB CC int 3
75B445BC CC int 3
75B445BD CC int 3
75B445BE CC int 3
75B445BF CC int 3
KERNELBASE.RaiseException:
75B445C0 8BFF mov edi,edi
75B445C2 55 push ebp
75B445C3 8BEC mov ebp,esp
75B445C5 83E4F8 and esp,-$08
75B445C8 83EC58 sub esp,$58
75B445CB A1345DBE75 mov eax,[$75be5d34]
75B445D0 33C4 xor eax,esp
75B445D2 89442454 mov [esp+$54],eax
75B445D6 8B4508 mov eax,[ebp+$08]
75B445D9 8B4D14 mov ecx,[ebp+$14]
75B445DC 8364240800 and dword ptr [esp+$08],$00
75B445E1 890424 mov [esp],eax
75B445E4 8B450C mov eax,[ebp+$0c]
75B445E7 83E001 and eax,$01
75B445EA C744240CC045B475 mov [esp+$0c],$75b445c0
75B445F2 89442404 mov [esp+$04],eax
75B445F6 85C9 test ecx,ecx
75B445F8 7439 jz $75b44633
75B445FA 8B4510 mov eax,[ebp+$10]
75B445FD 83F80F cmp eax,$0f
75B44600 7738 jnbe $75b4463a
75B44602 89442410 mov [esp+$10],eax
75B44606 C1E002 shl eax,$02
75B44609 50 push eax
75B4460A 51 push ecx
75B4460B 8D44241C lea eax,[esp+$1c]
75B4460F 50 push eax
75B44610 E8AFC40100 call $75b60ac4
75B44615 83C40C add esp,$0c
75B44618 8D0424 lea eax,[esp]
75B4461B 50 push eax
75B4461C FF159093BE75 call dword ptr [$75be9390]
-> 75B44622 8B4C2454 mov ecx,[esp+$54]
75B44626 33CC xor ecx,esp
75B44628 E8A3EF0000 call $75b535d0
75B4462D 8BE5 mov esp,ebp
75B4462F 5D pop ebp
75B44630 C21000 ret $0010
75B44633 8364241000 and dword ptr [esp+$10],$00
75B44638 EBDE jmp $75b44618
75B4463A 6A0F push $0f
我现在的猜测是,如果我有大约25帧/图的限制,那么问题就开始了。我的问题是我无法将此表格分解为较小的表格,因为我展示的图表只有一起显示时才有意义(它们是较大的生产流程的一部分)。我刚开始,我打算制作35-40张图。
考虑到我的项目在运行时可以正常运行,一种解决方案是在运行时添加帧/图表,但这有点违反了使用RAD的目的。
任何帮助表示感谢,谢谢。