Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Scale widgets are slow when inside tabs
Scale widgets are slow when inside tabs [message #1038484] Wed, 10 April 2013 23:38
Andrew Kallmeyer is currently offline Andrew KallmeyerFriend
Messages: 1
Registered: April 2013
Junior Member

In my application I'm creating a Scale widget that ends up having a really wide range sometimes. With input parameters that should be fairly common I want the scale to have a range from about 99741 to 49870700 and I'm setting the page increment to 49870700/10. This seems to work fine with the natives on Linux but on Windows the slider was nearly unresponsive and very stuttery instead of smooth when dragging.

I decided to start taking out gui elements to find the cause and I narrowed it down to the slider being inside a TabItem. Outside of a TabItem sliders work fine on Windows. In addition to that in my test case, but weirdly not in my application, the slider inside the tab crashes the program with a memory access violation when you drag it and release your mouse outside of the TabItem.

Here is the test case code I'm using:
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Scale;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.TabItem;
public class Test {
    protected Shell shell;
    public static void main(String[] args) {
        try {
            Test window = new Test();
        } catch (Exception e) {
    public void open() {
        Display display = Display.getDefault();
        while (!shell.isDisposed()) {
            if (!display.readAndDispatch()) {
    protected void createContents() {
        shell = new Shell();
        shell.setSize(600, 300);
        shell.setText("Scales Test");
        TabFolder tabFolder = new TabFolder(shell, SWT.NONE);
        tabFolder.setBounds(10, 10, 300, 241);
        TabItem tbtmTest = new TabItem(tabFolder, SWT.NONE);
        //This one, in the tab, runs slowly and causes a memory access violation
        Scale scale = new Scale(tabFolder, SWT.NONE);
        scale.setPageIncrement(49870700 / 10);
        //This one works fine and runs fast
        Scale scale2 = new Scale(shell, SWT.NONE);
        scale2.setBounds(310, 10, 590, 241);
        scale2.setPageIncrement(49870700 / 10);

And here is the hs_err_pid file generate from the memory access violation. I'm not sure if this error happens on other platforms but it does on Windows. Again, This crash was caused by dragging the Scale in the tab and releasing the mouse outside of the tab. Even when you release the mouse inside the tab some gui elements disappear and some blink.

# A fatal error has been detected by the Java Runtime Environment:
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000007ff50a7f646, pid=2840, tid=3096
# JRE version: 7.0_09-b05
# Java VM: Java HotSpot(TM) 64-Bit Server VM (23.5-b02 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C  [COMCTL32.dll+0x3f646]  SizeBoxHwnd+0x29b6
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
# If you would like to submit a bug report, please visit:
#   http:// / bugreport / crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
---------------  T H R E A D  ---------------
Current thread (0x0000000001f3e000):  JavaThread "main" [_thread_in_native, id=3096, stack(0x0000000001fb0000,0x00000000020b0000)]
siginfo: ExceptionCode=0xc0000005, reading address 0x0000000000000038
RAX=0x00000000003d3dd0, RBX=0x0000000000000000, RCX=0x00000000003cdac0, RDX=0x0000000000000000
RSP=0x00000000020ac6a0, RBP=0x00000000020ac7a0, RSI=0xffffffffd4012fb8, RDI=0x00000000003df770
R8 =0x00000000020ac698, R9 =0x00000000020ac7a0, R10=0x0000000000000000, R11=0x0000000000000202
R12=0x0000000000000001, R13=0xffffffffffffe9c4, R14=0x0000000000000000, R15=0xffffffffffffe9c4
RIP=0x000007ff50a7f646, EFLAGS=0x0000000000010203
Top of Stack: (sp=0x00000000020ac6a0)
0x00000000020ac6a0:   0000000000000001 0000000000000000
0x00000000020ac6b0:   0000000000000000 ffffffffd4012fb8
0x00000000020ac6c0:   00000000000000f1 0000000000000001
0x00000000020ac6d0:   0000000000000000 000000003c012c3c
0x00000000020ac6e0:   0000000000000002 000007ffffffe9c5
0x00000000020ac6f0:   00000000006607f2 0000000000000001
0x00000000020ac700:   0000000000000000 000000003c012c3c
0x00000000020ac710:   0000000000000000 00000000020ac840
0x00000000020ac720:   0000000000000000 00000000020ac758
0x00000000020ac730:   0000001600000000 000000f100000190
0x00000000020ac740:   0000000000000001 0000000000000080
0x00000000020ac750:   0000000000000000 0000001800000034
0x00000000020ac760:   0000000000000000 000000007543dddc
0x00000000020ac770:   000000000e2308c8 0000000000000000
0x00000000020ac780:   ffffffffd4012fb8 0000000000000000
0x00000000020ac790:   0000003400000000 0000000000000018
Instructions: (pc=0x000007ff50a7f646)
0x000007ff50a7f626:   44 3b bf d8 00 00 00 8b c3 0f 94 c0 ff c0 89 87
0x000007ff50a7f636:   ec 00 00 00 48 8b 47 40 48 8b 48 08 4e 8b 34 e9
0x000007ff50a7f646:   41 f6 46 38 04 0f 85 9c 01 00 00 f7 47 10 00 02
0x000007ff50a7f656:   00 00 75 0c 8b 47 74 41 39 06 0f 8f 9b 01 00 00
Register to memory mapping:
RAX=0x00000000003d3dd0 is an unknown value
RBX=0x0000000000000000 is an unknown value
RCX=0x00000000003cdac0 is an unknown value
RDX=0x0000000000000000 is an unknown value
RSP=0x00000000020ac6a0 is pointing into the stack for thread: 0x0000000001f3e000
RBP=0x00000000020ac7a0 is pointing into the stack for thread: 0x0000000001f3e000
RSI=0xffffffffd4012fb8 is an unknown value
RDI=0x00000000003df770 is an unknown value
R8 =0x00000000020ac698 is pointing into the stack for thread: 0x0000000001f3e000
R9 =0x00000000020ac7a0 is pointing into the stack for thread: 0x0000000001f3e000
R10=0x0000000000000000 is an unknown value
R11=0x0000000000000202 is an unknown value
R12=0x0000000000000001 is an unknown value
R13=0xffffffffffffe9c4 is an unknown value
R14=0x0000000000000000 is an unknown value
R15=0xffffffffffffe9c4 is an unknown value
Stack: [0x0000000001fb0000,0x00000000020b0000],  sp=0x00000000020ac6a0,  free space=1009k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [COMCTL32.dll+0x3f646]  SizeBoxHwnd+0x29b6
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  org.eclipse.swt.internal.win32.OS.CallWindowProcW(JJIJJ)J+0
j  org.eclipse.swt.internal.win32.OS.CallWindowProc(JJIJJ)J+14
j  org.eclipse.swt.widgets.TabFolder.callWindowProc(JIJJ)J+20
j  org.eclipse.swt.widgets.Control.windowProc(JIJJ)J+1969
j  org.eclipse.swt.widgets.Display.windowProc(JJJJ)J+271
v  ~StubRoutines::call_stub
j  org.eclipse.swt.internal.win32.OS.CallWindowProcW(JJIJJ)J+0
j  org.eclipse.swt.internal.win32.OS.CallWindowProc(JJIJJ)J+14
j  org.eclipse.swt.widgets.TabFolder.callWindowProc(JIJJ)J+20
j  org.eclipse.swt.widgets.Control.windowProc(JIJJ)J+1969
j  org.eclipse.swt.widgets.Display.windowProc(JJJJ)J+357
v  ~StubRoutines::call_stub
j  org.eclipse.swt.internal.win32.OS.CallWindowProcW(JJIJJ)J+0
j  org.eclipse.swt.internal.win32.OS.CallWindowProc(JJIJJ)J+14
j  org.eclipse.swt.widgets.Scale.callWindowProc(JIJJ)J+20
j  org.eclipse.swt.widgets.Widget.wmLButtonUp(JJJ)Lorg/eclipse/swt/internal/win32/LRESULT;+37
j  org.eclipse.swt.widgets.Control.WM_LBUTTONUP(JJ)Lorg/eclipse/swt/internal/win32/LRESULT;+7
j  org.eclipse.swt.widgets.Control.windowProc(JIJJ)J+1231
j  org.eclipse.swt.widgets.Display.windowProc(JJJJ)J+357
v  ~StubRoutines::call_stub
j  org.eclipse.swt.internal.win32.OS.DispatchMessageW(Lorg/eclipse/swt/internal/win32/MSG;)J+0
j  org.eclipse.swt.internal.win32.OS.DispatchMessage(Lorg/eclipse/swt/internal/win32/MSG;)J+7
j  org.eclipse.swt.widgets.Display.readAndDispatch()Z+64
j  Test.main([Ljava/lang/String;)V+9
v  ~StubRoutines::call_stub
---------------  P R O C E S S  ---------------
Java Threads: ( => current thread )
  0x000000000b53f800 JavaThread "Service Thread" daemon [_thread_blocked, id=14364, stack(0x000000000d920000,0x000000000da20000)]
  0x000000000b53d000 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=12968, stack(0x000000000d820000,0x000000000d920000)]
  0x000000000b531800 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=13636, stack(0x000000000d720000,0x000000000d820000)]
  0x000000000b528800 JavaThread "Attach Listener" daemon [_thread_blocked, id=13788, stack(0x000000000d620000,0x000000000d720000)]
  0x000000000b524000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=8620, stack(0x000000000d520000,0x000000000d620000)]
  0x000000000b4be800 JavaThread "Finalizer" daemon [_thread_blocked, id=8772, stack(0x000000000d420000,0x000000000d520000)]
  0x000000000b4b7800 JavaThread "Reference Handler" daemon [_thread_blocked, id=15112, stack(0x000000000d320000,0x000000000d420000)]
=>0x0000000001f3e000 JavaThread "main" [_thread_in_native, id=3096, stack(0x0000000001fb0000,0x00000000020b0000)]
Other Threads:
  0x000000000b4b2800 VMThread [stack: 0x000000000d220000,0x000000000d320000] [id=7540]
  0x000000000b55c800 WatcherThread [stack: 0x000000000da20000,0x000000000db20000] [id=12760]
VM state:not at safepoint (normal execution)
VM Mutex/Monitor currently owned by a thread: None
 PSYoungGen      total 37696K, used 4035K [0x00000007d5eb0000, 0x00000007d88c0000, 0x0000000800000000)
  eden space 32320K, 12% used [0x00000007d5eb0000,0x00000007d62a0c58,0x00000007d7e40000)
  from space 5376K, 0% used [0x00000007d8380000,0x00000007d8380000,0x00000007d88c0000)
  to   space 5376K, 0% used [0x00000007d7e40000,0x00000007d7e40000,0x00000007d8380000)
 ParOldGen       total 86208K, used 0K [0x0000000781c00000, 0x0000000787030000, 0x00000007d5eb0000)
  object space 86208K, 0% used [0x0000000781c00000,0x0000000781c00000,0x0000000787030000)
 PSPermGen       total 21248K, used 3880K [0x000000077ca00000, 0x000000077dec0000, 0x0000000781c00000)
  object space 21248K, 18% used [0x000000077ca00000,0x000000077cdca1e0,0x000000077dec0000)
Card table byte_map: [0x0000000005270000,0x0000000005690000] byte_map_base: 0x000000000168b000
Polling page: 0x0000000001de0000
Code Cache  [0x00000000021b0000, 0x0000000002420000, 0x00000000051b0000)
 total_blobs=359 nmethods=10 adapters=301 free_code_cache=48663Kb largest_free_block=49812864
Compilation events (10 events):
Event: 0.085 Thread 0x000000000b531800 nmethod 6 0x0000000002211690 code [0x00000000022117e0, 0x0000000002211948]
Event: 0.086 Thread 0x000000000b531800    7             sun.nio.cs.UTF_8$Encoder::encode (361 bytes)
Event: 0.089 Thread 0x000000000b53d000 nmethod 5 0x0000000002222510 code [0x0000000002222660, 0x0000000002222b18]
Event: 0.090 Thread 0x000000000b531800 nmethod 7 0x0000000002226850 code [0x00000000022269a0, 0x0000000002226e88]
Event: 0.098 Thread 0x000000000b53d000    8    (143 bytes)
Event: 0.101 Thread 0x000000000b53d000 nmethod 8 0x0000000002227190 code [0x0000000002227300, 0x0000000002227630]
Event: 0.115 Thread 0x000000000b531800    9             java.lang.String::startsWith (72 bytes)
Event: 0.117 Thread 0x000000000b531800 nmethod 9 0x0000000002224690 code [0x00000000022247e0, 0x00000000022249d8]
Event: 0.139 Thread 0x000000000b53d000   10    (336 bytes)
Event: 0.154 Thread 0x000000000b53d000 nmethod 10 0x000000000222ce10 code [0x000000000222d040, 0x000000000222e058]
GC Heap History (0 events):
No events
Deoptimization events (0 events):
No events
Internal exceptions (10 events):
Event: 0.140 Thread 0x0000000001f3e000 Threw 0x00000007d61ce3c8 at C:\jdk7u1_64p\jdk7u9\hotspot\src\share\vm\prims\jvm.cpp:1166
Event: 0.143 Thread 0x0000000001f3e000 Threw 0x00000007d61d2b50 at C:\jdk7u1_64p\jdk7u9\hotspot\src\share\vm\prims\jvm.cpp:1166
Event: 0.372 Thread 0x0000000001f3e000 Threw 0x00000007d61d7658 at C:\jdk7u1_64p\jdk7u9\hotspot\src\share\vm\prims\jvm.cpp:1166
Event: 0.372 Thread 0x0000000001f3e000 Threw 0x00000007d61d8fc0 at C:\jdk7u1_64p\jdk7u9\hotspot\src\share\vm\prims\jvm.cpp:1166
Event: 0.373 Thread 0x0000000001f3e000 Threw 0x00000007d61e0d20 at C:\jdk7u1_64p\jdk7u9\hotspot\src\share\vm\prims\jvm.cpp:1166
Event: 0.379 Thread 0x0000000001f3e000 Threw 0x00000007d61e68c0 at C:\jdk7u1_64p\jdk7u9\hotspot\src\share\vm\prims\jvm.cpp:1166
Event: 2.733 Thread 0x0000000001f3e000 Threw 0x00000007d61ecfe8 at C:\jdk7u1_64p\jdk7u9\hotspot\src\share\vm\prims\jvm.cpp:1166
Event: 3.059 Thread 0x0000000001f3e000 Threw 0x00000007d61f19f8 at C:\jdk7u1_64p\jdk7u9\hotspot\src\share\vm\prims\jvm.cpp:1166
Event: 3.060 Thread 0x0000000001f3e000 Threw 0x00000007d61f6920 at C:\jdk7u1_64p\jdk7u9\hotspot\src\share\vm\prims\jvm.cpp:1166
Event: 3.060 Thread 0x0000000001f3e000 Threw 0x00000007d61fb650 at C:\jdk7u1_64p\jdk7u9\hotspot\src\share\vm\prims\jvm.cpp:1166
Events (10 events):
Event: 2.733 loading class 0x000000000db25960
Event: 2.733 loading class 0x000000000db25960 done
Event: 3.059 loading class 0x000000000dbf5760
Event: 3.059 loading class 0x000000000dbf5760 done
Event: 3.060 loading class 0x000000000dbf79a0
Event: 3.060 loading class 0x000000000dbf79a0 done
Event: 3.060 loading class 0x000000000dbf7260
Event: 3.060 loading class 0x000000000dbf7260 done
Event: 3.060 loading class 0x000000000dc99630
Event: 3.060 loading class 0x000000000dc99630 done
Dynamic libraries:
0x000007f635cc0000 - 0x000007f635cf4000         C:\Program Files\Java\jre7\bin\javaw.exe
0x000007ff55e20000 - 0x000007ff55fde000         C:\Windows\SYSTEM32\ntdll.dll
0x000007ff54b70000 - 0x000007ff54ca6000         C:\Windows\system32\KERNEL32.DLL
0x000007ff53190000 - 0x000007ff53283000         C:\Windows\system32\KERNELBASE.dll
0x000007ff54800000 - 0x000007ff548de000         C:\Windows\system32\ADVAPI32.dll
0x000007ff55cd0000 - 0x000007ff55e1c000         C:\Windows\system32\USER32.dll
0x000007ff50a40000 - 0x000007ff50ca9000         C:\Windows\WinSxS\\COMCTL32.dll
0x000007ff546c0000 - 0x000007ff54765000         C:\Windows\system32\msvcrt.dll
0x000007ff55460000 - 0x000007ff554a8000         C:\Windows\SYSTEM32\sechost.dll
0x000007ff54a30000 - 0x000007ff54b70000         C:\Windows\system32\RPCRT4.dll
0x000007ff548f0000 - 0x000007ff54a30000         C:\Windows\system32\GDI32.dll
0x000007ff545e0000 - 0x000007ff54619000         C:\Windows\system32\IMM32.DLL
0x000007ff559f0000 - 0x000007ff55b05000         C:\Windows\system32\MSCTF.dll
0x000007ff52d00000 - 0x000007ff52d40000         C:\Windows\system32\nvinitx.dll
0x0000000075a60000 - 0x0000000075b31000         C:\Program Files\Java\jre7\bin\msvcr100.dll
0x0000000075340000 - 0x0000000075a5f000         C:\Program Files\Java\jre7\bin\server\jvm.dll
0x000007ff429e0000 - 0x000007ff429e9000         C:\Windows\SYSTEM32\WSOCK32.dll
0x000007ff4f5f0000 - 0x000007ff4f610000         C:\Windows\SYSTEM32\WINMM.dll
0x000007ff55450000 - 0x000007ff55457000         C:\Windows\system32\PSAPI.DLL
0x000007ff550b0000 - 0x000007ff55108000         C:\Windows\system32\WS2_32.dll
0x000007ff4f5a0000 - 0x000007ff4f5d2000         C:\Windows\SYSTEM32\WINMMBASE.dll
0x000007ff55cc0000 - 0x000007ff55cc9000         C:\Windows\system32\NSI.dll
0x0000000075330000 - 0x000000007533f000         C:\Program Files\Java\jre7\bin\verify.dll
0x0000000075300000 - 0x0000000075328000         C:\Program Files\Java\jre7\bin\java.dll
0x00000000752e0000 - 0x00000000752f5000         C:\Program Files\Java\jre7\bin\zip.dll
0x0000000010000000 - 0x00000000100a8000         C:\Users\[redacted]\.swt\lib\win32\x86_64\swt-win32-4234.dll
0x000007ff55870000 - 0x000007ff559ee000         C:\Windows\system32\ole32.dll
0x000007ff54fe0000 - 0x000007ff550a3000         C:\Windows\system32\OLEAUT32.dll
0x000007ff55110000 - 0x000007ff551b1000         C:\Windows\system32\comdlg32.dll
0x000007ff4f380000 - 0x000007ff4f3fd000         C:\Windows\SYSTEM32\WINSPOOL.DRV
0x000007ff53290000 - 0x000007ff54578000         C:\Windows\system32\SHELL32.dll
0x000007ff49640000 - 0x000007ff49656000         C:\Windows\SYSTEM32\USP10.dll
0x000007ff55220000 - 0x000007ff5544e000         C:\Windows\system32\WININET.dll
0x000007ff52fb0000 - 0x000007ff53187000         C:\Windows\system32\CRYPT32.dll
0x000007ff551d0000 - 0x000007ff55220000         C:\Windows\system32\SHLWAPI.dll
0x000007ff55b10000 - 0x000007ff55cc0000         C:\Windows\SYSTEM32\combase.dll
0x000007ff55650000 - 0x000007ff55866000         C:\Windows\system32\iertutil.dll
0x000007ff52e00000 - 0x000007ff52e16000         C:\Windows\system32\MSASN1.dll
0x000007ff51ed0000 - 0x000007ff51f66000         C:\Windows\SYSTEM32\SHCORE.DLL
0x000007ff51b00000 - 0x000007ff51be3000         C:\Windows\system32\uxtheme.dll
0x000007ff36e00000 - 0x000007ff36e11000         C:\Program Files (x86)\Dexpot\hooxpot64.dll
0x000007ff50db0000 - 0x000007ff50dd1000         C:\Windows\SYSTEM32\dwmapi.dll
0x000007ff52b50000 - 0x000007ff52b5a000         C:\Windows\SYSTEM32\CRYPTBASE.dll
0x000007ff52af0000 - 0x000007ff52b4c000         C:\Windows\SYSTEM32\bcryptPrimitives.dll
0x000007ff4c1d0000 - 0x000007ff4c32a000         C:\Windows\SYSTEM32\propsys.dll
0x000007ff54620000 - 0x000007ff546b6000         C:\Windows\SYSTEM32\clbcatq.dll
0x000007ff47ce0000 - 0x000007ff47e43000         C:\Windows\SYSTEM32\dbghelp.dll
VM Arguments:
jvm_args: -Dfile.encoding=UTF-8
java_command: Test
Launcher Type: SUN_STANDARD
Environment Variables:
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 58 Stepping 9, GenuineIntel
---------------  S Y S T E M  ---------------
OS: Windows 8 , 64 bit Build 9200
CPU:total 8 (4 cores per cpu, 2 threads per core) family 6 model 58 stepping 9, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, ht, tsc, tscinvbit, tscinv
Memory: 4k page, physical 8271672k(3657556k free), swap 9516856k(4341676k free)
vm_info: Java HotSpot(TM) 64-Bit Server VM (23.5-b02) for windows-amd64 JRE (1.7.0_09-b05), built on Sep 24 2012 21:45:04 by "java_re" with unknown MS VC++:1600
time: Wed Apr 10 15:58:06 2013
elapsed time: 3 seconds
Previous Topic:Disbale right click popup menu in a Text control
Next Topic:SWT.VIRTUAL and Lists
Goto Forum:

Current Time: Thu Apr 26 08:07:39 GMT 2018

Powered by FUDForum. Page generated in 0.01941 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software