Debugging problems

Hi,

we have some Delphi applications here which - since intoducing FlexCel - slow down the debugging process significantly. Specifically, the end of it.

A typical application here uses about 2200 units. This leads to a pause of about 2 seconds after closing the application (and even after killing it) when it runs within the debugger as a 64 bit process. So far, so bad.

Now after we introduced FlexCel, the number of units raised to about 3800, causing a pause of 15 seconds after closing.

During the pause Delphi freezes, and the process dbkw64_23_0.exe uses 100 % of a whole CPU.<!--if gte mso 9>
<w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true" DefSemi="true" DefQat="false" DefPriority="99" LatentStyleCount="267">
<w:LsdException Locked="false" Priority="0" Semi="false" UnhideWhenUsed="false" Qat="true" Name="Normal"/>
<w:LsdException Locked="false" Priority="9" Semi="false" UnhideWhenUsed="false" Qat="true" Name="ing 1"/>
<w:LsdException Locked="false" Priority="9" Qat="true" Name="ing 2"/>
<w:LsdException Locked="false" Priority="9" Qat="true" Name="ing 3"/>
<w:LsdException Locked="false" Priority="9" Qat="true" Name="ing 4"/>
<w:LsdException Locked="false" Priority="9" Qat="true" Name="ing 5"/>
<w:LsdException Locked="false" Priority="9" Qat="true" Name="ing 6"/>
<w:LsdException Locked="false" Priority="9" Qat="true" Name="ing 7"/>
<w:LsdException Locked="false" Priority="9" Qat="true" Name="ing 8"/>
<w:LsdException Locked="false" Priority="9" Qat="true" Name="ing 9"/>
<w:LsdException Locked="false" Priority="39" Name="toc 1"/>
<w:LsdException Locked="false" Priority="39" Name="toc 2"/>
<w:LsdException Locked="false" Priority="39" Name="toc 3"/>
<w:LsdException Locked="false" Priority="39" Name="toc 4"/>
<w:LsdException Locked="false" Priority="39" Name="toc 5"/>
<w:LsdException Locked="false" Priority="39" Name="toc 6"/>
<w:LsdException Locked="false" Priority="39" Name="toc 7"/>
<w:LsdException Locked="false" Priority="39" Name="toc 8"/>
<w:LsdException Locked="false" Priority="39" Name="toc 9"/>
<w:LsdException Locked="false" Priority="35" Qat="true" Name="caption"/>
<w:LsdException Locked="false" Priority="10" Semi="false" UnhideWhenUsed="false" Qat="true" Name="Title"/>
<w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
<w:LsdException Locked="false" Priority="11" Semi="false" UnhideWhenUsed="false" Qat="true" Name="Subtitle"/>
<w:LsdException Locked="false" Priority="22" Semi="false" UnhideWhenUsed="false" Qat="true" Name="Strong"/>
<w:LsdException Locked="false" Priority="20" Semi="false" UnhideWhenUsed="false" Qat="true" Name="Emphasis"/>
<w:LsdException Locked="false" Priority="59" Semi="false" UnhideWhenUsed="false" Name="Table Grid"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>
<w:LsdException Locked="false" Priority="1" Semi="false" UnhideWhenUsed="false" Qat="true" Name="No Spacing"/>
<w:LsdException Locked="false" Priority="60" Semi="false" UnhideWhenUsed="false" Name="Light Shading"/>
<w:LsdException Locked="false" Priority="61" Semi="false" UnhideWhenUsed="false" Name="Light List"/>
<w:LsdException Locked="false" Priority="62" Semi="false" UnhideWhenUsed="false" Name="Light Grid"/>
<w:LsdException Locked="false" Priority="63" Semi="false" UnhideWhenUsed="false" Name="Medium Shading 1"/>
<w:LsdException Locked="false" Priority="64" Semi="false" UnhideWhenUsed="false" Name="Medium Shading 2"/>
<w:LsdException Locked="false" Priority="65" Semi="false" UnhideWhenUsed="false" Name="Medium List 1"/>
<w:LsdException Locked="false" Priority="66" Semi="false" UnhideWhenUsed="false" Name="Medium List 2"/>
<w:LsdException Locked="false" Priority="67" Semi="false" UnhideWhenUsed="false" Name="Medium Grid 1"/>
<w:LsdException Locked="false" Priority="68" Semi="false" UnhideWhenUsed="false" Name="Medium Grid 2"/>
<w:LsdException Locked="false" Priority="69" Semi="false" UnhideWhenUsed="false" Name="Medium Grid 3"/>
<w:LsdException Locked="false" Priority="70" Semi="false" UnhideWhenUsed="false" Name="Dark List"/>
<w:LsdException Locked="false" Priority="71" Semi="false" UnhideWhenUsed="false" Name="Colorful Shading"/>
<w:LsdException Locked="false" Priority="72" Semi="false" UnhideWhenUsed="false" Name="Colorful List"/>
<w:LsdException Locked="false" Priority="73" Semi="false" UnhideWhenUsed="false" Name="Colorful Grid"/>
<w:LsdException Locked="false" Priority="60" Semi="false" UnhideWhenUsed="false" Name="Light Shading Accent 1"/>
<w:LsdException Locked="false" Priority="61" Semi="false" UnhideWhenUsed="false" Name="Light List Accent 1"/>
<w:LsdException Locked="false" Priority="62" Semi="false" UnhideWhenUsed="false" Name="Light Grid Accent 1"/>
<w:LsdException Locked="false" Priority="63" Semi="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>
<w:LsdException Locked="false" Priority="64" Semi="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>
<w:LsdException Locked="false" Priority="65" Semi="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/>
<w:LsdException Locked="false" Priority="34" Semi="false" UnhideWhenUsed="false" Qat="true" Name="List Paragraph"/>
<w:LsdException Locked="false" Priority="29" Semi="false" UnhideWhenUsed="false" Qat="true" Name="Quote"/>
<w:LsdException Locked="false" Priority="30" Semi="false" UnhideWhenUsed="false" Qat="true" Name="Intense Quote"/>
<w:LsdException Locked="false" Priority="66" Semi="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>
<w:LsdException Locked="false" Priority="67" Semi="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>
<w:LsdException Locked="false" Priority="68" Semi="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>
<w:LsdException Locked="false" Priority="69" Semi="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>
<w:LsdException Locked="false" Priority="70" Semi="false" UnhideWhenUsed="false" Name="Dark List Accent 1"/>
<w:LsdException Locked="false" Priority="71" Semi="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>
<w:LsdException Locked="false" Priority="72" Semi="false" UnhideWhenUsed="false" Name="Colorful List Accent 1"/>
<w:LsdException Locked="false" Priority="73" Semi="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>
<w:LsdException Locked="false" Priority="60" Semi="false" UnhideWhenUsed="false" Name="Light Shading Accent 2"/>
<w:LsdException Locked="false" Priority="61" Semi="false" UnhideWhenUsed="false" Name="Light List Accent 2"/>
<w:LsdException Locked="false" Priority="62" Semi="false" UnhideWhenUsed="false" Name="Light Grid Accent 2"/>
<w:LsdException Locked="false" Priority="63" Semi="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>
<w:LsdException Locked="false" Priority="64" Semi="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>
<w:LsdException Locked="false" Priority="65" Semi="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>
<w:LsdException Locked="false" Priority="66" Semi="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>
<w:LsdException Locked="false" Priority="67" Semi="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>
<w:LsdException Locked="false" Priority="68" Semi="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>
<w:LsdException Locked="false" Priority="69" Semi="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>
<w:LsdException Locked="false" Priority="70" Semi="false" UnhideWhenUsed="false" Name="Dark List Accent 2"/>
<w:LsdException Locked="false" Priority="71" Semi="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>
<w:LsdException Locked="false" Priority="72" Semi="false" UnhideWhenUsed="false" Name="Colorful List Accent 2"/>
<w:LsdException Locked="false" Priority="73" Semi="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>
<w:LsdException Locked="false" Priority="60" Semi="false" UnhideWhenUsed="false" Name="Light Shading Accent 3"/>
<w:LsdException Locked="false" Priority="61" Semi="false" UnhideWhenUsed="false" Name="Light List Accent 3"/>
<w:LsdException Locked="false" Priority="62" Semi="false" UnhideWhenUsed="false" Name="Light Grid Accent 3"/>
<w:LsdException Locked="false" Priority="63" Semi="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>
<w:LsdException Locked="false" Priority="64" Semi="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>
<w:LsdException Locked="false" Priority="65" Semi="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>
<w:LsdException Locked="false" Priority="66" Semi="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>
<w:LsdException Locked="false" Priority="67" Semi="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>
<w:LsdException Locked="false" Priority="68" Semi="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>
<w:LsdException Locked="false" Priority="69" Semi="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>
<w:LsdException Locked="false" Priority="70" Semi="false" UnhideWhenUsed="false" Name="Dark List Accent 3"/>
<w:LsdException Locked="false" Priority="71" Semi="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>
<w:LsdException Locked="false" Priority="72" Semi="false" UnhideWhenUsed="false" Name="Colorful List Accent 3"/>
<w:LsdException Locked="false" Priority="73" Semi="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>
<w:LsdException Locked="false" Priority="60" Semi="false" UnhideWhenUsed="false" Name="Light Shading Accent 4"/>
<w:LsdException Locked="false" Priority="61" Semi="false" UnhideWhenUsed="false" Name="Light List Accent 4"/>
<w:LsdException Locked="false" Priority="62" Semi="false" UnhideWhenUsed="false" Name="Light Grid Accent 4"/>
<w:LsdException Locked="false" Priority="63" Semi="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>
<w:LsdException Locked="false" Priority="64" Semi="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>
<w:LsdException Locked="false" Priority="65" Semi="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>
<w:LsdException Locked="false" Priority="66" Semi="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>
<w:LsdException Locked="false" Priority="67" Semi="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>
<w:LsdException Locked="false" Priority="68" Semi="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>
<w:LsdException Locked="false" Priority="69" Semi="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>
<w:LsdException Locked="false" Priority="70" Semi="false" UnhideWhenUsed="false" Name="Dark List Accent 4"/>
<w:LsdException Locked="false" Priority="71" Semi="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>
<w:LsdException Locked="false" Priority="72" Semi="false" UnhideWhenUsed="false" Name="Colorful List Accent 4"/>
<w:LsdException Locked="false" Priority="73" Semi="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>
<w:LsdException Locked="false" Priority="60" Semi="false" UnhideWhenUsed="false" Name="Light Shading Accent 5"/>
<w:LsdException Locked="false" Priority="61" Semi="false" UnhideWhenUsed="false" Name="Light List Accent 5"/>
<w:LsdException Locked="false" Priority="62" Semi="false" UnhideWhenUsed="false" Name="Light Grid Accent 5"/>
<w:LsdException Locked="false" Priority="63" Semi="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>
<w:LsdException Locked="false" Priority="64" Semi="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>
<w:LsdException Locked="false" Priority="65" Semi="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>
<w:LsdException Locked="false" Priority="66" Semi="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>
<w:LsdException Locked="false" Priority="67" Semi="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>
<w:LsdException Locked="false" Priority="68" Semi="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>
<w:LsdException Locked="false" Priority="69" Semi="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>
<w:LsdException Locked="false" Priority="70" Semi="false" UnhideWhenUsed="false" Name="Dark List Accent 5"/>
<w:LsdException Locked="false" Priority="71" Semi="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>
<w:LsdException Locked="false" Priority="72" Semi="false" UnhideWhenUsed="false" Name="Colorful List Accent 5"/>
<w:LsdException Locked="false" Priority="73" Semi="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>
<w:LsdException Locked="false" Priority="60" Semi="false" UnhideWhenUsed="false" Name="Light Shading Accent 6"/>
<w:LsdException Locked="false" Priority="61" Semi="false" UnhideWhenUsed="false" Name="Light List Accent 6"/>
<w:LsdException Locked="false" Priority="62" Semi="false" UnhideWhenUsed="false" Name="Light Grid Accent 6"/>
<w:LsdException Locked="false" Priority="63" Semi="false" UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>
<w:LsdException Locked="false" Priority="64" Semi="false" UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>
<w:LsdException Locked="false" Priority="65" Semi="false" UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>
<w:LsdException Locked="false" Priority="66" Semi="false" UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>
<w:LsdException Locked="false" Priority="67" Semi="false" UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>
<w:LsdException Locked="false" Priority="68" Semi="false" UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>
<w:LsdException Locked="false" Priority="69" Semi="false" UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>
<w:LsdException Locked="false" Priority="70" Semi="false" UnhideWhenUsed="false" Name="Dark List Accent 6"/>
<w:LsdException Locked="false" Priority="71" Semi="false" UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>
<w:LsdException Locked="false" Priority="72" Semi="false" UnhideWhenUsed="false" Name="Colorful List Accent 6"/>
<w:LsdException Locked="false" Priority="73" Semi="false" UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>
<w:LsdException Locked="false" Priority="19" Semi="false" UnhideWhenUsed="false" Qat="true" Name="Subtle Emphasis"/>
<w:LsdException Locked="false" Priority="21" Semi="false" UnhideWhenUsed="false" Qat="true" Name="Intense Emphasis"/>
<w:LsdException Locked="false" Priority="31" Semi="false" UnhideWhenUsed="false" Qat="true" Name="Subtle Reference"/>
<w:LsdException Locked="false" Priority="32" Semi="false" UnhideWhenUsed="false" Qat="true" Name="Intense Reference"/>
<w:LsdException Locked="false" Priority="33" Semi="false" UnhideWhenUsed="false" Qat="true" Name="Book Title"/>
<w:LsdException Locked="false" Priority="37" Name="Bibliography"/>
<w:LsdException Locked="false" Priority="39" Qat="true" Name="TOC ing"/>
</w:LatentStyles>



Running the application without debugger or debugging as 32 bit does not show the effect.

Developers use 64 bit versions for debugging because Delphi's stability is better than with 32 bit. Killing the process in question is possible, but Delphi does not know about the end of the debugged process in this case.

Do you have an idea how to reduce the teardown time? Again, the time is not used before the end of the application, but after the end.

Thanks,
Micha

Hi,
I haven't seen something similar here, but then again in my tests I "only" have about 1800 units (including FlexCel). The embarcadero debugging process does appear for about a second, but that is it. I imagine that it might be something that grows exponentially, so if you get to 3800 units it might get slower.

But well, my first question would be if you are using the debug dcus in FlexCel? The FlexCel installer installs things this way:
  In the library path, we put the release dcus
  In the debug path, we put the debug dcus

Then depending in if you choose "use debug dcus" or not, you use the debug or release dcus of FlexCel. My guess is that using release dcus might solve this, even if I can't be sure because as said I see no delay here in 64 bits.

But can you try it and let me know?

ps:I just realized it might not be clear, so I'll clarify it: by "use debug dcus" I mean right click project, options, compiling, and then under debugging "use debug dcus".

Thanks for your fast support. Unfortunately, the time used by the so called debugger kernel is the same in both cases, with release and with debug dcus.

For me it is perfectly clear that the reason is within the debugger kernel, but I doubt Embarcadero will solve it shortly. So I need to find another solution.

I'm currently working on moving my code that uses FlexCel into a dll, hoping this will solve the problem. Anyway, I'll let you know.

Regards,
Micha

I wonder if using runtime packages makes any difference?  After all a runtime package is a dll, but it is simpler to do (just check a checkbox) than moving the code actually to a dll.

Sorry for the delay. We've decided not to use bpls since we don't have any bpl in place yet. I've moved the FlexCel code into a dll, and with the help of System.SimpleShareMem everything works well now.

Micha

Hi,

did you install Andy's IDE-fix pack? http://andy.jgknet.de/blog/ide-tools/ide-fix-pack/
This could increase the debugging performance. 

Also read this http://andy.jgknet.de/blog/2016/05/ide-fix-pack-5-95-for-delphi-10-1-berlin/