Opened 2 weeks ago

Last modified 13 days ago

#2818 reviewing defect

GUI is unresponsive if multiple displayed algorithms are running

Reported by: mkommend Owned by: architects
Priority: highest Milestone: HeuristicLab 3.3.15
Component: Optimization.Views Version: 3.3.14
Keywords: Cc:

Description (last modified by mkommend)

If multiple algorithms are displayed next to each other (tabs side by side) and running the HL GUI slows down and becomes unresponsive. This becomes so severe that HL cannot be closed anymore, but must be terminated.

The attached file illustrates the bug by opening two fast running algorithms (GA - TSP Popsize 10), showing them side by side and starting both asynchronously.

A possible explanation is that the event queue displaying the GUI is filled two fast (ToStringChanged events) and cannot catch upl anymore.

Attachments (1)

HL GUI Bomb.hl (60.8 KB) - added by mkommend 2 weeks ago.
Added sample script that freezes the GUI

Download all attachments as: .zip

Change History (5)

Changed 2 weeks ago by mkommend

Added sample script that freezes the GUI

comment:1 Changed 2 weeks ago by mkommend

  • Description modified (diff)

comment:2 Changed 2 weeks ago by mkommend

PFleck discovered that manual calls to Application.DoEvents resolve the issue. However, the use of Application.DoEvents should be avoided if possible (MSDN,Stackoverflow).

If the following code is added to the ResultCollection the GUI stays responsive and the problem does not occur anymore. However, this is not extensively tested and possible side-effects are unknown.

   protected override void Item_ToStringChanged(object sender, EventArgs e) {
      if (InvokeRequired) {
        Invoke(new EventHandler(Item_ToStringChanged), sender, e);
        return;
      }
      
      base.Item_ToStringChanged(sender, e);
      System.Windows.Forms.Application.DoEvents();
   }

comment:3 Changed 13 days ago by mkommend

  • Owner changed from architects to mkommend
  • Status changed from new to accepted

comment:4 Changed 13 days ago by mkommend

  • Owner changed from mkommend to architects
  • Status changed from accepted to reviewing

r15312: Added call to Application.DoEvents in ResultCollectionView.Item_ToStringChanged to avoid congestion of the event queue.

This has been discussed with swagner, gkronber, and abeham. Additionally, the performance impact has been profiled and the performance is only slightly affected when results are actually displayed (GA-TSP sample).

Note: See TracTickets for help on using tickets.