How to optimize JavaFX layout pass time? - javafx

I have written a JavaFx Application(JDK 8), which parses a private format XML (XML contains all of the Shape attributes such as coordinate, size, fill, stroke and so on) to construct a scene graph with about 4000-5000 Nodes layout according to their coordinate in the SubScene.
Every time I open a new private XML, the new SubScene needs 2-3 second lagged to show in my screen.
I tried "-Djavafx.pulseLogger=true" in VM argument,and show the logger below, but I do not know how to optimize the show time. I tried to force the node parent Group with no layout pass, but the time till very big. I also read the articles abort how to optimise the performance abort Javafx, but I still cannot fixed the lag performance correct.
PULSE: 637 [570ms:1701ms]
T37 (-570 +570ms): Layout Pass
T37 (0 +484ms): CSS Pass
T37 (484 +9ms): Layout Pass
T37 (493 +4ms): Update bounds
T37 (498 +0ms): Waiting for previous rendering
T37 (498 +16ms): Copy state to render graph
T30 (515 +0ms): Dirty Opts Computed
T30 : 2 different dirty regions to render
T30 : Dirty Region 0: RectBounds { minX:406.0, minY:23.0, maxX:440.0, maxY:38.0} (w:34.0, h:15.0)
T30 : Render Root Path 0: [com.sun.javafx.sg.prism.NGGroup#2734b5a6, com.sun.javafx.sg.prism.NGRegion#2c4e529a, com.sun.javafx.sg.prism.NGRegion#5812bf43, com.sun.javafx.sg.prism.NGRegion#78dbaadd, com.sun.javafx.sg.prism.NGRegion#4a9171aa, com.sun.javafx.sg.prism.NGRegion#1bb83d84, com.sun.javafx.sg.prism.NGRegion#1486dde6]
T30 : Dirty Region 1: RectBounds { minX:0.0, minY:69.0, maxX:1904.0, maxY:1006.0} (w:1904.0, h:937.0)
T30 : Render Root Path 1: [com.sun.javafx.sg.prism.NGGroup#2734b5a6, com.sun.javafx.sg.prism.NGRegion#2c4e529a, com.sun.javafx.sg.prism.NGRegion#1cdbe0a1]
T30 (515 +0ms): Render Roots Discovered
T30 : Slow background path for null
T30 (515 +0ms): Painting
T30 : Slow shape path for null
T30 (515 +1185ms): Painting
T30 (1700 +0ms): Presenting
Counters:
CacheFilter rebuilding: 1
Cached region shape image used: 3
NGRegion renderBackgroundShape slow path: 1
NGRegion renderBackgrounds slow path: 1
Nodes rendered: 5384
Nodes visited during render: 7917
Rendering region shape image to cache: 1
PULSE: 638 [1499ms:241ms]
T37 (0 +0ms): CSS Pass
T37 (0 +5ms): Layout Pass
T37 (6 +1ms): Update bounds
T37 (7 +195ms): Waiting for previous rendering
T37 (202 +0ms): Copy state to render graph
T30 (202 +0ms): Dirty Opts Computed
T30 : 4 different dirty regions to render
T30 : Dirty Region 0: RectBounds { minX:6.0, minY:1010.0, maxX:142.0, maxY:1037.0} (w:136.0, h:27.0)
T30 : Render Root Path 0: [com.sun.javafx.sg.prism.NGGroup#2734b5a6, com.sun.javafx.sg.prism.NGRegion#2c4e529a, com.sun.javafx.sg.prism.NGRegion#5aeb10ed, com.sun.javafx.sg.prism.NGRegion#1e40ff4a]
T30 : Dirty Region 1: RectBounds { minX:294.0, minY:1012.0, maxX:444.0, maxY:1035.0} (w:150.0, h:23.0)
T30 : Render Root Path 1: [com.sun.javafx.sg.prism.NGGroup#2734b5a6, com.sun.javafx.sg.prism.NGRegion#2c4e529a, com.sun.javafx.sg.prism.NGRegion#5aeb10ed, com.sun.javafx.sg.prism.NGRegion#1e40ff4a]
T30 : Dirty Region 2: RectBounds { minX:470.0, minY:1012.0, maxX:534.0, maxY:1035.0} (w:64.0, h:23.0)
T30 : Render Root Path 2: [com.sun.javafx.sg.prism.NGGroup#2734b5a6, com.sun.javafx.sg.prism.NGRegion#2c4e529a, com.sun.javafx.sg.prism.NGRegion#5aeb10ed, com.sun.javafx.sg.prism.NGRegion#1e40ff4a]
T30 : Dirty Region 3: RectBounds { minX:6.0, minY:70.0, maxX:128.0, maxY:95.0} (w:122.0, h:25.0)
T30 : Render Root Path 3: [com.sun.javafx.sg.prism.NGGroup#2734b5a6, com.sun.javafx.sg.prism.NGRegion#2c4e529a, com.sun.javafx.sg.prism.NGRegion#1cdbe0a1, com.sun.javafx.sg.prism.NGRegion#479f54bb, com.sun.javafx.sg.prism.NGRegion#107cfd69]
T30 (203 +0ms): Render Roots Discovered
T30 : Slow background path for null
T30 : Slow background path for null
T30 (203 +15ms): Painting
T30 (218 +0ms): Painting
T30 (218 +0ms): Painting
T30 (218 +1ms): Painting
T30 (219 +22ms): Presenting
Counters:
Cached region shape image used: 3
NGRegion renderBackgrounds slow path: 2
Nodes rendered: 42
Nodes visited during render: 94
Picture MMI Requset Time Register= local 275 Tue Jun 12 11:46:49 CST 2018
PULSE: 639 [909ms:159ms]
T37 (0 +0ms): CSS Pass
T37 (0 +0ms): Layout Pass
T37 (1 +1ms): Update bounds
T37 (2 +0ms): Waiting for previous rendering
T37 (2 +0ms): Copy state to render graph
T30 (2 +0ms): Dirty Opts Computed
T30 : 4 different dirty regions to render
T30 : Dirty Region 0: RectBounds { minX:6.0, minY:1010.0, maxX:142.0, maxY:1037.0} (w:136.0, h:27.0)
T30 : Render Root Path 0: [com.sun.javafx.sg.prism.NGGroup#2734b5a6, com.sun.javafx.sg.prism.NGRegion#2c4e529a, com.sun.javafx.sg.prism.NGRegion#5aeb10ed, com.sun.javafx.sg.prism.NGRegion#1e40ff4a]
T30 : Dirty Region 1: RectBounds { minX:294.0, minY:1012.0, maxX:444.0, maxY:1035.0} (w:150.0, h:23.0)
T30 : Render Root Path 1: [com.sun.javafx.sg.prism.NGGroup#2734b5a6, com.sun.javafx.sg.prism.NGRegion#2c4e529a, com.sun.javafx.sg.prism.NGRegion#5aeb10ed, com.sun.javafx.sg.prism.NGRegion#1e40ff4a]
T30 : Dirty Region 2: RectBounds { minX:470.0, minY:1012.0, maxX:534.0, maxY:1035.0} (w:64.0, h:23.0)
T30 : Render Root Path 2: [com.sun.javafx.sg.prism.NGGroup#2734b5a6, com.sun.javafx.sg.prism.NGRegion#2c4e529a, com.sun.javafx.sg.prism.NGRegion#5aeb10ed, com.sun.javafx.sg.prism.NGRegion#1e40ff4a]
T30 : Dirty Region 3: RectBounds { minX:1.0, minY:96.0, maxX:1903.0, maxY:1005.0} (w:1902.0, h:909.0)
T30 : Render Root Path 3: [com.sun.javafx.sg.prism.NGGroup#2734b5a6, com.sun.javafx.sg.prism.NGRegion#2c4e529a, com.sun.javafx.sg.prism.NGRegion#1cdbe0a1, com.sun.javafx.sg.prism.NGRegion#4c1f5ed1, com.sun.javafx.sg.prism.NGRegion#48f39e62]
T30 (2 +0ms): Render Roots Discovered
T30 : Slow background path for null
T30 : Slow background path for null
T30 (2 +0ms): Painting
T30 (3 +0ms): Painting
T30 (3 +0ms): Painting
T30 (3 +155ms): Painting
T30 (158 +0ms): Presenting
Counters:
CacheFilter rebuilding: 1
NGRegion renderBackgrounds slow path: 2
Nodes rendered: 5419
Nodes visited during render: 7994

I had loading the xml in FXThread.I put it in a Task.And it seems a little better,But till a little lag when I open a new XML in Task.Below is the pulse logger.
PULSE: 1620 [16ms:676ms]
T16 (-15 +16ms): Layout Pass
T16 (0 +308ms): CSS Pass
T16 (308 +6ms): Layout Pass
T16 (315 +4ms): Update bounds
T16 (320 +0ms): Waiting for previous rendering
T16 (320 +23ms): Copy state to render graph
T13 (343 +0ms): Dirty Opts Computed
T13 : 2 different dirty regions to render
T13 : Dirty Region 0: RectBounds { minX:406.0, minY:22.0, maxX:440.0, maxY:38.0} (w:34.0, h:16.0)
T13 : Render Root Path 0: [com.sun.javafx.sg.prism.NGGroup#4f54e04e, com.sun.javafx.sg.prism.NGRegion#4b1b2a7e, com.sun.javafx.sg.prism.NGRegion#a8df84, com.sun.javafx.sg.prism.NGRegion#4f89e98d, com.sun.javafx.sg.prism.NGRegion#1192367, com.sun.javafx.sg.prism.NGRegion#17791b79, com.sun.javafx.sg.prism.NGRegion#51ebb2ed]
T13 : Dirty Region 1: RectBounds { minX:0.0, minY:64.0, maxX:1267.0, maxY:650.0} (w:1267.0, h:586.0)
T13 : Render Root Path 1: [com.sun.javafx.sg.prism.NGGroup#4f54e04e]
T13 (344 +0ms): Render Roots Discovered
T13 : Slow background path for null
T13 (344 +0ms): Painting
T13 : Slow background path for null
T13 (344 +331ms): Painting
T13 (676 +0ms): Presenting
Counters:
CacheFilter rebuilding: 1
NGRegion renderBackgrounds slow path: 2
Nodes rendered: 4523
Nodes visited during render: 6733
PULSE: 1621 [352ms:351ms]
T16 (0 +0ms): CSS Pass
T16 (0 +0ms): Layout Pass
T16 (0 +1ms): Update bounds
T16 (2 +322ms): Waiting for previous rendering
T16 (324 +0ms): Copy state to render graph
T13 (324 +0ms): Dirty Opts Computed
T13 : 1 different dirty regions to render
T13 : Dirty Region 0: RectBounds { minX:5.0, minY:69.0, maxX:130.0, maxY:95.0} (w:125.0, h:26.0)
T13 : Render Root Path 0: [com.sun.javafx.sg.prism.NGGroup#4f54e04e, com.sun.javafx.sg.prism.NGRegion#4b1b2a7e, com.sun.javafx.sg.prism.NGRegion#1bb5992b, com.sun.javafx.sg.prism.NGRegion#76a3f03, com.sun.javafx.sg.prism.NGRegion#42e2bd5f]
T13 (324 +0ms): Render Roots Discovered
T13 : Slow background path for null
T13 : Slow shape path for null
T13 : Slow shape path for null
T13 (325 +4ms): Painting
T13 (329 +22ms): Presenting
Counters:
NGRegion renderBackgroundShape slow path: 2
NGRegion renderBackgrounds slow path: 1
Nodes rendered: 12
Nodes visited during render: 13
[1622 335ms:16ms][1623 15ms:0ms][1624 0ms:0ms]

Related

Connect to Azure ML Workspace with Python SDK1 in Compute Instance

I have a script that allow me to connect to Azure ML Workspace. But it only works in local (interactive authentification) or on Cluster Instances while doing experiences.
But I can not manage to make it work in Compute Instances.
from azureml.core import Workspace
from azureml.core.run import Run, _OfflineRun
run = Run.get_context()
if isinstance(run, _OfflineRun):
workspace = Workspace(
"subscription_id",
"resource_group",
"workspace_name",
)
else:
workspace = run.experiment.workspace
I tried to use https://learn.microsoft.com/en-us/python/api/azureml-core/azureml.core.authentication.msiauthentication?view=azure-ml-py but it did not work.
from azureml.core.authentication import MsiAuthentication
from azureml.core import Workspace
msi_auth = MsiAuthentication()
workspace = Workspace(
"subscription_id",
"resource_group",
"workspace_name",
auth=msi_auth,
)
File ~/localfiles/.venv/lib/python3.8/site-packages/azureml/_vendor/azure_cli_core/auth/adal_authentication.py:65, in MSIAuthenticationWrapper.set_token(self)
63 from azureml._vendor.azure_cli_core.azclierror import AzureConnectionError, AzureResponseError
64 try:
---> 65 super(MSIAuthenticationWrapper, self).set_token()
66 except requests.exceptions.ConnectionError as err:
67 logger.debug('throw requests.exceptions.ConnectionError when doing MSIAuthentication: \n%s',
68 traceback.format_exc())
File ~/localfiles/.venv/lib/python3.8/site-packages/msrestazure/azure_active_directory.py:596, in MSIAuthentication.set_token(self)
594 def set_token(self):
595 if _is_app_service():
--> 596 self.scheme, _, self.token = get_msi_token_webapp(self.resource, self.msi_conf)
597 elif "MSI_ENDPOINT" in os.environ:
598 self.scheme, _, self.token = get_msi_token(self.resource, self.port, self.msi_conf)
File ~/localfiles/.venv/lib/python3.8/site-packages/msrestazure/azure_active_directory.py:548, in get_msi_token_webapp(resource, msi_conf)
546 raise RuntimeError(err_msg)
547 _LOGGER.debug('MSI: token retrieved')
--> 548 token_entry = result.json()
549 return token_entry['token_type'], token_entry['access_token'], token_entry
File ~/localfiles/.venv/lib/python3.8/site-packages/requests/models.py:975, in Response.json(self, **kwargs)
971 return complexjson.loads(self.text, **kwargs)
972 except JSONDecodeError as e:
973 # Catch JSON-related errors and raise as requests.JSONDecodeError
974 # This aliases json.JSONDecodeError and simplejson.JSONDecodeError
--> 975 raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
JSONDecodeError: Expecting value: line 1 column 1 (char 0)
I do not want to use SDK2, it will break all my existing code.
I don't understand why the identidy is not automatically managed when starting the Compute Instances like Cluster Instances.
Does any one has a solution for this?
Use the below code blocks to connect to the existing workspace using the python SDK using the compute instances.
Create a compute instance
from azureml.core import Workspace
ws = Workspace.from_config()
ws.get_details()
Output:
Connecting to workspace using Config file:
import os
from azureml.core import Workspace
ws = Workspace.from_config()

Using "QWidget *QLayoutItem::widget()" throws a segment-fault (into qobjectdefs_impl.h)

I'm using QTabWidget(s) inside QTabWidget tabs and when I try to get a "child" QTabWidget which is stored in the layout of a tab of the "parent" QTabWidget, I have an segment-fault error.
PS : I'm using Qt Creator v4.8.1, Qtv5.6.3 and Windows 7 64-bits OS (VM under VBox v6.0.4)
Initially, the following line throws the error
dbTablesTabWidget = static_cast<QTabWidget*>(ui->tabWidget->currentWidget()->layout()->takeAt(i)->widget());
I have tried without the "static_cast" with the following line but the error is always here
QWidget *widget = ui->tabWidget->currentWidget()->layout()->takeAt(i)->widget();
My last try (without return the QWidget pointer) with always the same "segment-fault" error.
ui->tabWidget->currentWidget()->layout()->takeAt(i)->widget();
That I don't understand is that the following line (first line in the first for loop)
QString itemClass = ui->tabWidget->currentWidget()->layout()->takeAt(i)->widget()->metaObject()->className();
works fine althought it includes the same "base code".
The segment-fault error appears in the "qobjectdefs_impl.h" file :
1 MainWindow::addRow mainwindow.cpp 298 0x403de6
2 QtPrivate::FunctorCall<QtPrivate::IndexesList<>, QtPrivate::List<>, void, void (MainWindow:: *)()>::call(void (MainWindow:: *)(), MainWindow *, void * *) qobjectdefs_impl.h 501 0x410175
3 QtPrivate::FunctionPointer<void (MainWindow:: *)()>::call<QtPrivate::List<>, void>(void (MainWindow:: *)(), MainWindow *, void * *) qobjectdefs_impl.h 520 0x4103e2
4 QtPrivate::QSlotObject<void (MainWindow:: *)(), QtPrivate::List<>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void * *, bool *) qobject_impl.h 143 0x410243
5 QtPrivate::QSlotObjectBase::call qobject_impl.h 124 0x6ba5d241
6 QMetaObject::activate qobject.cpp 3715 0x6b8fc213
7 QMetaObject::activate qobject.cpp 3595 0x6b8fbc3e
8 QAbstractButton::clicked moc_qabstractbutton.cpp 307 0x9c0685
9 QAbstractButtonPrivate::emitClicked qabstractbutton.cpp 404 0x9be459
10 QAbstractButtonPrivate::click qabstractbutton.cpp 397 0x9be3f4
11 QAbstractButton::mouseReleaseEvent qabstractbutton.cpp 1002 0x9bf6f7
12 QWidget::event qwidget.cpp 8757 0x8f6881
13 QAbstractButton::event qabstractbutton.cpp 959 0x9bf56c
14 QPushButton::event qpushbutton.cpp 673 0xa55168
15 QApplicationPrivate::notify_helper qapplication.cpp 3804 0x8bf880
16 QApplication::notify qapplication.cpp 3277 0x8bd5f1
17 QCoreApplication::notifyInternal2 qcoreapplication.cpp 1015 0x6b8d37dd
18 QCoreApplication::sendSpontaneousEvent qcoreapplication.h 228 0xc2fb5d
19 QApplicationPrivate::sendMouseEvent qapplication.cpp 2773 0x8bc2cb
20 QWidgetWindow::handleMouseEvent qwidgetwindow.cpp 607 0x90f314
... <plus>
Below, an extract of the addRow Method ("custom" private slot called after the click on a QPushButton)
// var
int dbIndex = ui->tabWidget->currentIndex();
int tableIndex = 0;
QTabWidget *dbTablesTabWidget;
// Détection de l'index de l'item du layout de l'onglet de la BDD actuellement sélectionné
// -> Détection de la position du widget (jeu d'onglets des tables) dans le layout pour récupérer l'index de la table actuelle.
for (int i=0; i<ui->tabWidget->currentWidget()->layout()->count(); i++)
{
QString itemClass = ui->tabWidget->currentWidget()->layout()->takeAt(i)->widget()->metaObject()->className();
qDebug(itemClass.toLatin1());
if (itemClass == "QTabWidget")
{
qDebug("Cet élément est un QTabWidget !!!");
//*** The following line throws a segment fault ***
//dbTablesTabWidget = static_cast<QTabWidget*>(ui->tabWidget->currentWidget()->layout()->takeAt(i)->widget());
//QWidget *widget = ui->tabWidget->currentWidget()->layout()->takeAt(i)->widget();
ui->tabWidget->currentWidget()->layout()->takeAt(i)->widget();
tableIndex = dbTablesTabWidget->currentIndex();
}
}
I'm a newbie with Qt and I don't see where the segment-fault error could come from.
The compilation process is OK, please see below (french language version)
15:53:12: Configuration inchangée, étape qmake sautée.
15:53:12: Débute : "C:\Qt\Tools\mingw492_32\bin\mingw32-make.exe" -j1
C:/Qt/Tools/mingw492_32/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory 'E:/Projects_Info_Slink/_Training/C++/QTCreatorProject/DataBaseViewerGUI/build-DataBaseViewerGUI-Desktop_Qt_5_6_3_MinGW_32bit-Debug'
mingw32-make[1]: Nothing to be done for 'first'.
mingw32-make[1]: Leaving directory 'E:/Projects_Info_Slink/_Training/C++/QTCreatorProject/DataBaseViewerGUI/build-DataBaseViewerGUI-Desktop_Qt_5_6_3_MinGW_32bit-Debug'
15:53:13: Le processus "C:\Qt\Tools\mingw492_32\bin\mingw32-make.exe" s'est terminé normalement.
15:53:13: Temps écoulé : 00:01.
Your page in tabwidget can have any widget along with a child tab widget.
To keep it simple, probably you can try the below way:
//GET YOUR CURRENT PAGE IN FIRST TAB WIDGET
QWidget *widget = ui->tabWidget->currentWidget();
//FROM THE CURRENT PAGE FIND THE CHILD TAB WIDGETS
QList<QTabWidget*> tabWidgets = widget->findChildren<QTabWidget*>();
//USE THE FOUND WIDGET FOR YOUR PURPOSE. DO SOME SAFETY CHECKS FOR LIST.
QTabWidget* requiredTabWidget = tabWidgets[0];
I have finally found the error :
I should use layout()->itemAt(i) instead layout()->takeAt(i).
It explains why the error occurs at the second time.
takeAt remove the item from the list, so during the next call, the item doesn't exist in the list.
PS : for QList object, this is at instead itemAt to get the element from the list of element.

Graphviz ignores rank attribute if no edges between nodes

I'musing Graphviz to render some hierarchical structure. So far the use of subgraphs has been sub-optimal for achieving what I'm looking for.
This is what I would like to get
(colors represent different tiers in the hierarchy so they need to follow this order). For making this image I used invisible links, but that's really not an option in a real world scenario.
However, at the moment this is what I'm getting
using this .dot file
graph {
// Global config
rankdir=BT
node [style="filled" fontcolor="white" shape="box"]
// Rank (hierarchies)
{ rank=same; 258 }
{ rank=same; 259 }
{ rank=same; 260 }
{ rank=same; 261 262 }
// Nodes
// Tasks
258 [label="John Cleese" fillcolor="#E8B04D"]
// Project Goals
259 [label="Michael Palin" fillcolor="#C0C56B"]
// Identities
260 [label="Eric Idle" fillcolor="#FF8D61"]
// Virtues
261 [label="Graham Chapman" fillcolor="crimson"]
262 [label="Terry Jones" fillcolor="crimson"]
// Edges
259 -- 260 [style="bold" color="#3790af"]
}
Is it posible for Graphviz to honor rank before edges? If so, how would I proceed?
Your problem is easily solved by the addition of a few invisible edges that make the various ranks (that you set up correctly) work as you want. Note the simple addition of three invisible edges near the bottom:
graph {
// Global config
rankdir=BT
node [style="filled" fontcolor="white" shape="box"]
// Rank (hierarchies)
{ rank=same; 258 }
{ rank=same; 259 }
{ rank=same; 260 }
{ rank=same; 261 bl 262 }
// Nodes
// Tasks
258 [label="John Cleese" fillcolor="#E8B04D"]
// Project Goals
259 [label="Michael Palin" fillcolor="#C0C56B"]
// Identities
260 [label="Eric Idle" fillcolor="#FF8D61"]
// Virtues
261 [label="Graham Chapman" fillcolor="crimson"]
262 [label="Terry Jones" fillcolor="crimson"]
// Edges
259 -- 260 [style="bold" color="#3790af"]
258--259 [style=invis]
260--261 [style=invis]
260--262 [style=invis]
260--bl [style=invis]
bl [style=invis label="" height=0, width=0]
}
I also added an invisible balancing node in the center, bl to help center the graph better.

Xamarin 2.3.3.193 and ItemTemplate

I've updated Xamarin Forms in my Xamarin project. Now this code doesn't work any more.
var view = (View)ItemTemplate.CreateContent();
if (view != null) {
var bindableObject = view as BindableObject;
if (bindableObject != null)
bindableObject.BindingContext = newItem;
_imageStack.Children.Add(view);
}
The problem is (View)ItemTemplate.CreateContent() goes in error:
Message:
Can't resolve name on Element
Source: Xamarin.Forms.Xaml
Stack:
at Xamarin.Forms.Xaml.ReferenceExtension.ProvideValue
(System.IServiceProvider serviceProvider) [0x000b6] in
[...]
In the Debug window I can see the following info
02-20 17:44:04.450 I/art (13331): Starting a blocking GC Explicit
02-20 17:44:04.482 I/art (13331): Explicit concurrent mark sweep GC freed 436(24KB) AllocSpace objects, 0(0B) LOS objects, 21% free, 14MB/18MB, paused 762us total 31.310ms
02-20 17:44:04.482 I/System (13331): FinalizerDaemon: finalize objects = 48
02-20 17:44:04.484 D/Mono (13331): GC_TAR_BRIDGE bridges 20 objects 20 opaque 0 colors 20 colors-bridged 20 colors-visible 20 xref 0 cache-hit 0 cache-semihit 0 cache-miss 0 setup 0.11ms tarjan 0.06ms scc-setup 0.08ms gather-xref 0.00ms xref-setup 0.00ms cleanup 0.30ms
02-20 17:44:04.484 D/Mono (13331): GC_BRIDGE: Complete, was running for 34.10ms
02-20 17:44:04.484 D/Mono (13331): GC_MINOR: (Nursery full) time 4.22ms, stw 4.53ms promoted 32K major size: 3504K in use: 2748K los size: 6404K in use: 5406K
My function save an image in memory from the camera in ImageSource format, byte[] and the length in byte of this image.
This indicates that the XAML you are loading contains a {x:Reference foo} markup extension and, at runtime, no element defined with a x:Name="foo" was found in the hierarchy.
Without seeing your XAML, it's impossible to figure if the issue is in your code, or if it's a bug in Xamarin.Forms.

Random 500 & 404 errors - Gitlab

I get random friendly 500 and 404 errors on my Gitlab installation. Everything works fine except that.
It is really annoying, sometimes the pages work, sometimes I need to refresh the page a couple of times for it to display.
Here's the errors I get in /etc/httpd/logs/error_log
ActionView::Template::Error (cannot map `/home/git/gitlabhq/vendor/bundle/ruby/1.9.1/gems/charlock_holmes-0.6.8/ext/charlock_holmes/dst/share/misc/magic.mgc' (Cannot allocate memory)):
1: - file = tree_full_path(content)
2: %tr{ class: "tree-item #{tree_hex_class(content)}", url: tree_file_project_ref_path(#project, #ref, file) } 3: %td.tree-item-file-name
4: = tree_icon(content)
5: = link_to truncate(content.name, length: 40), tree_file_project_ref_path(#project, #ref || #commit.id, file), remote: :true
6: %td.tree_time_ago.cgray
7: - if index == 1
app/helpers/tree_helper.rb:4:in `tree_icon'
app/views/refs/_tree_item.html.haml:4:in `_app_views_refs__tree_item_html_haml__359204534986361082_50783740'
app/views/refs/_tree.html.haml:37:in `block in _app_views_refs__tree_html_haml__2791169573873392874_51939480'
app/views/refs/_tree.html.haml:36:in `each'
app/views/refs/_tree.html.haml:36:in `_app_views_refs__tree_html_haml__2791169573873392874_51939480'
app/views/refs/tree.html.haml:2:in `_app_views_refs_tree_html_haml__1175555315298044292_52501320'
app/controllers/refs_controller.rb:40:in `tree'
^GOut of memory (Needed 8160 bytes)
ActionView::Template::Error (Mysql2::Error: MySQL client ran out of memory: SELECT COUNT(*) FROM `users` ): 25: %h5 Users
26: .data.padded 27: = link_to admin_users_path do
28: %h1= User.count
29: %hr
30: = link_to 'New User', new_admin_user_path, class: "btn small"
31: config/initializers/connection_fix.rb:22:in `execute'
app/views/admin/dashboard/index.html.haml:28:in `block in _app_views_admin_dashboard_index_html_haml___3571568531981020694_30874020'
app/views/admin/dashboard/index.html.haml:27:in `_app_views_admin_dashboard_index_html_haml___3571568531981020694_30874020'
I am new to the Ruby world.
Additional Notes:
OS: Centos 5
Gitlab v2.8.2
The issue almost never appears on admin pages or what not.. only on repository pages such as file tree, graphs or commits

Resources