Delphi 10.3:内存不足,无法在IDE中打开DFM
我正在DelphiRio10.3社区开发一个项目,目前有24个单元。我遇到问题的这个特殊表单包含28个相同类型的帧,每个帧包含一个带有几个按钮和复选框(打印图表、显示/隐藏系列/标签等)的TChart组件。在20-25帧/图表之前一切都很好,但昨天我又增加了几帧,直到28帧/图表。在设计和运行时都没有任何错误,因此我在一天结束时愉快地关闭了Delphi 问题是在我下一次启动Delphi时开始的。当我简单地打开我的项目时,我得到的确切错误是“错误创建表单:内存不足”。在确认错误后,项目仍然可以正常打开,除了这个具有28帧/图表的特定DFM文件。我仍然可以编译和运行项目,没有任何问题,但我无法在IDE中可视化表单以进一步开发它 我知道我达到了某种程度的限制,尽管项目/表格不是很大。我有一个32GB内存的i7,Windows显示我有26GB的空闲空间,所以我认为这足够了 我在网上没有找到任何关于这个确切错误消息的参考,但发现了一些类似的编译器错误,这与我的情况不同: 然而,我确实尝试了在Windows中增加交换文件大小的解决方法,但没有成功 我还安装了Andy提供的最新IDE补丁包6.4.2,同样没有成功: DFM文件大约有3000行,因此仅粘贴其中28个帧/图表中的一个:Delphi 10.3:内存不足,无法在IDE中打开DFM,delphi,delphi-10.3-rio,Delphi,Delphi 10.3 Rio,我正在DelphiRio10.3社区开发一个项目,目前有24个单元。我遇到问题的这个特殊表单包含28个相同类型的帧,每个帧包含一个带有几个按钮和复选框(打印图表、显示/隐藏系列/标签等)的TChart组件。在20-25帧/图表之前一切都很好,但昨天我又增加了几帧,直到28帧/图表。在设计和运行时都没有任何错误,因此我在一天结束时愉快地关闭了Delphi 问题是在我下一次启动Delphi时开始的。当我简单地打开我的项目时,我得到的确切错误是“错误创建表单:内存不足”。在确认错误后,项目仍然可以正常
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的目的
感谢您的帮助。您不能在此附加任何内容。用你最喜欢的编辑器(包括记事本)打开.DFM作为文本,Ctrl+A选择全部,切换到你的帖子,点击它,然后用Ctrl+V粘贴。再次选择.DFM的内容,点击Ctrl+I或{}工具栏按钮将其格式化为代码。另外,FWIW:Delphi IDE是32位的,因此,所有可用的额外RAM都没有多大用处。我怀疑您遇到了单个资源大小的限制。.DFM的内容被编译成二进制文件并直接链接到可执行文件中,然后在运行时由应用程序流式导入。资源大小作为该资源的一部分作为DWORD值嵌入。一个100k行的DFM很容易超过那个DWORD。好吧,我犯了一个错误,它是114000个字符,不是行(也更正了帖子)。所以总行数略高于3000行,文件大小为101KB。一无是处。除此之外,正如我在项目编译和运行良好之前所说的,表单会在运行时显示,因此它显然不是资源大小的问题。但是,它显然与帧/组件的数量有关。我回到了一个较旧的版本,图表较少,它没有问题。因此,我现在看到的唯一出路是从DFM中删除一些帧,直到它正确打开,并在运行时在代码中创建它们。关闭IDE,重新启动PC,删除项目的.Dsk文件,然后重新打开IDE和项目。在那之后,你还得到错误吗?