Subscribe: marcocantu.blog
http://blog.marcocantu.com/blog_rss.xmldata
Preview: marcocantu.blog

marcocantu.blog



Techie Italian Blogging on Delphi and More



Updated: 2017-08-16T08:58:47.118Z

 



Workaround for FMX Memory Leaks on Windows in 10.2.1

2017-08-16T08:58:47.118Z

Here is a relatively simple workaround for a memory leak on termination of FireMonkey Windows applications with Tokyo Release 1.

Many of our customers today write FireMonkey Windows applications. We recently got some customer reports on FMX memory leaks on Windows using RAD Studio 10.2 Release 1 (or Tokyo Release 1). The issue is reported at https://quality.embarcadero.com/browse/RSP-18774 and https://stackoverflow.com/questions/45588741/delphi-recompiling-application-with-10-2-1-causes-memory-leaks.

If you encounter such issues after installing 10.2.1, we recommend trying the workaround below. We will address this issue in the future.

To our knowledge, the memory leak doesn't happen during program execution, but on termination because a cleanup thread does not excute in time. Delphi MVP Stefan Glienke suggested a relatively simple workaround both on the Quality Portal bug report and in the StackOverflow page linked above. By calling CheckSynchronize (from System.Classes) you can have the application wait for the cleanup threads to execute. This does a quick sync, but does not cause any noticeable delay. 

There are different places where you can put this code, but the simplest one for me is a finalization block in the main form source code (no need to update the library units). This is an example of the code added to the end of the main form unit, along with activating memory leak reporting:

(image)

Another very good suggestion is to change the project file (the .dpr file), but your mileage might vary -- you can also consider fixing the library as this will fix all of your applications at once.

(image)



Creators Update BPL Loading Issue and Tokyo Release 1

2017-08-14T10:10:03.785Z

As mentioned in the release notes of Tokyo 10.2.1, the latest release of RAD Studio addresses the issues caused by Creators Update DLL and BPL loading As mentioned in the release notes of Tokyo 10.2.1, the latest release of RAD Studio addresses the issues caused by Windows 10 Creators Update and related with DLL and BPL loading. The issue is caused by a change (a bug!) in the DLL loading algorithm of the operating system, an issue that Microsoft has fixed in the new coming release of Windows 10, currently known as Fall Creators Update. I've already covered the problem in a past blog post, http://blog.marcocantu.com/blog/2017-june-delphi-packages-creators-update.html. There is also some discussion on the related Quality Portal bug report at https://quality.embarcadero.com/browse/RSP-17972. Tokyo Release 1 Fixes the Issue In this new post I don't want to get back to the technical information already discussed there, but focus on what's changed in Delphi Tokyo Release 1. In short, Embarcadero developers modified the compilers and linkers to emit a single export table section for each BPL, to avoid each section of the export table to cause the operating system to reload the same library once more. As a experiment, on my primary system (which is running Windows 10 Creators Update) I took a very simple one button VCL application, activated runtime packages (which causes dependencies from the RTL and VCL packages) and started it in the debugger. I used Berlin 10.1.2 and Tokyo 10.2.1 side by side and you can clearly see the difference in the image below: The Detailed Event Logs In the detailed log for Tokyo 10.2.1 you can see that some unloading and reloading still happens (unloading is set in bold), but the same can be seen for some Microsoft system DLLs: Thread Start: Thread ID: 3972. Process ProjectLoad.exe (2964) Process Start: C:\Users\marco\Documents\Embarcadero\Studio\Projects\Win32\Debug\ProjectLoad.exe. Base Address: $00400000. Process ProjectLoad.exe (2964) Module Load: ProjectLoad.exe. Has Debug Info. Base Address: $00400000. Process ProjectLoad.exe (2964) Module Load: ntdll.dll. No Debug Info. Base Address: $76EF0000. Process ProjectLoad.exe (2964) Module Load: KERNEL32.dll. No Debug Info. Base Address: $75320000. Process ProjectLoad.exe (2964) Module Unload: KERNEL32.dll. Process ProjectLoad.exe (2964) Module Load: KERNEL32.dll. No Debug Info. Base Address: $75320000. Process ProjectLoad.exe (2964) Module Load: KERNELBASE.dll. No Debug Info. Base Address: $74DE0000. Process ProjectLoad.exe (2964) Thread Start: Thread ID: 6872. Process ProjectLoad.exe (2964) Thread Start: Thread ID: 12820. Process ProjectLoad.exe (2964) Module Load: vcl250.bpl. Has Debug Info. Base Address: $50A80000. Process ProjectLoad.exe (2964) Module Load: rtl250.bpl. Has Debug Info. Base Address: $00C00000. Process ProjectLoad.exe (2964) Module Unload: rtl250.bpl. Process ProjectLoad.exe (2964) Module Load: SHLWAPI.dll. No Debug Info. Base Address: $75160000. Process ProjectLoad.exe (2964) Module Load: msvcrt.dll. No Debug Info. Base Address: $75DF0000. Process ProjectLoad.exe (2964) Module Load: combase.dll. No Debug Info. Base Address: $75BB0000. Process ProjectLoad.exe (2964) Module Load: ucrtbase.dll. No Debug Info. Base Address: $76200000. Process ProjectLoad.exe (2964) Module Load: RPCRT4.dll. No Debug Info. Base Address: $76C60000. Process ProjectLoad.exe (2964) Module Load: SspiCli.dll. No Debug Info. Base Address: $739C0000. Process ProjectLoad.exe (2964) Module Load: CRYPTBASE.dll. No Debug Info. Base Address: $739B0000. Process ProjectLoad.exe (2964) Module Load: bcryptPrimitives.dll. No Debug Info. Base Address: $750F0000. Process ProjectLoad.exe (2964) Thread Start: Thread ID: 1944. Process ProjectLoad.exe (2964) Module Load: SECHOST.dll. No Debug Info. Base Address: $755C0000. Process ProjectLoad.exe (2964) Module Load: GDI32.dll. No Debug Info. Base Address: $76DD0000. Process ProjectLoad.exe (2964) Module Load: gdi32full.dll. No Debug Info. Base Addres[...]



Quality Portal and Tokyo Release 1

2017-08-11T11:05:47.922Z

The RAD Studio 10.2.1 release was focused on bug fixing and addressed some of the most voted issues reported by customers in Quality Portal. This is some overall status information.

The RAD Studio 10.2.1 release (earlier this week) was focused on bug fixing. You can find the list of issues that have been addressed at http://edn.embarcadero.com/article/44763. The list includes 186 customer reported issues there were either fixed or cannot be reproduced any more -- so they also got fix, even if "indirectly" (that is, while fixing some related bug). If we include also duplicate items, expected behavior, and issues we decided not to fix (for some reason) or are not applicable any more, the total of Quality Portal bugs closed is 241.

This list of bugs and these counts don't include bugs reported internally and closed. All bugs touched by the release are 402 (including all resolutions). While there are a few relevant issues not handled (and we are evaluating how and when to release a fix for those) and a few only partially done (we opened a Phase 2 bug for Android performance) a lot if the issues that were resolved improve support of the latest versions of iOS and Xcode, Creators Update (with BPL loading -- more on this in a separate blog post) and Android performance and quality (including the June hot fix).

If we look at the overall status, this is the 30 days status (captured today):

(image)

Having pushed out a release, this is very favorable. This is the more realistic 365 days (1 year) status report (this includes bugs only, not feature requests):

(image)

What the graph tells is that we need to (literally) double our effort to address bugs and improve the product quality, but both Tokyo and Tokyo Release 1 made a good dent.

The last thing I want to draw your attention to is the list of most voted issues before Release 1:

(image)

We did address many of the issues with the highest number of votes in that list:

- Non-functional debugger with Creators Update (which is by itself a Windows issue)

- Android Tokyo app are super slow (data is in the report, but we need to and will do more to address this)

- StringToJString leak

- iOS 10.3

Among those left open, the Chinese VK is very tricky (and regional), IDE DPI awareness is bordering a feature request and something we are making steps towards (we did fix a few more HighDPI VCL issues in Tokyo Release 1) and the C++ linkers issue was addressed, at least in part (we are making more tests and might officially close it).

RAD Studio and Delphi and C++Builder customers keep pushing us to focus more on quality. Over the last couple of years QPS (Quality, Performance, Stability) was and still is today a top priority in our development effort. Some new features like Linux support were really important, therefore we need to keep striking a good balance between features, quality, and bug fixing. But quality is key.

(image)



Delphi Tokyo Release 1 or 10.2.1 is Now Available

2017-08-08T11:03:42.714Z

Embarcadero has just made available RAD Studio Tokyo Release 1 (formerly known as Update 1).

You can read more about the release and its rationale in the PM article published in the community:

https://community.embarcadero.com/article/16556-rad-studio-10-2-1-released-today

For the actual release information docWiki page, including how to obtain the release, what's new, known issues, visit:

http://docwiki.embarcadero.com/RADStudio/Tokyo/en/10.2_Tokyo_-_Release_1

For a more detailed of issues fixed in this release, see the EDN article at:

http://edn.embarcadero.com/article/44763

We had to put a significant effort into some of the issues, like those caused by Creators Update and changes in iOS, so very happy to make this new version of Delphi and C++ Builder available to our customers. 

(image)



Some Data from the 2017 RAD Studio Developers Survey

2017-07-27T08:42:37.421Z

This blog post includes some selected results from the RAD Studio Developers Survey the Embarcadero PM team run last April. Hope you find them as interesting as we do. As most of you know, the Embarcadero PM team has been running fairly extensive yearly surveys regularly. We had the last yearly survey in April 2017. In the past, the company decision has been not to share data coming from the survey, as some of it is fairly sensitive in terms of business analysis and planning. But given that not all of the information fits into this category, this year Embarcadero has decided to share some of the results of the main yearly developer's survey -- that saw several thousand people taking the time and effort to go over almost 100 questions. We plan on sharing some more information in the future, in blog posts focused on specific product features. RAD Studio Versions Owned One interesting question we ask our customer is to indicate not only which is the last version they own or are using, but also list all of the versions they owned. This is not historical data, as it depends on developers who took this year survey. A lot of the current customers have been using the product for a long time, but not all versions have been equally successful: General Information Channels Another question we want to share the answer for is which online outlets developers go to get information and learn about the product. Notice this was a question allowing multiple answers. This is the list in order of preference (from most popular to least popular), of the group of sites that got over a thousand votes: 1. Stack Overflow 2. Embarcadero Website 3. Embarcadero Community (community.embarcadero.com) 4. Embarcadero Webinars 5. Old forum (forums.embarcadero.com) 6. MVP and Other User's Blogs 7. Quality Portal (quality.embarcadero.com) These are additional sites and information channels that received less than a thousand votes, again listed from most to least popular 8. User groups and local community forums 9. Country specific developers forums 10. Google+ Delphi Community 11. Live "in person" events 12. Facebook 13. Twitter Appears our customers are not really social media fanatics, with the limited exception of the Google+ community. Most Relevant Development Scenarios These are the key focus areas our customers, in terms of product use. This is another question allowing multiple answers, and the 4 most popular were: 1. Windows VCL Desktop clients 2. FMX/mobile clients 3. FMX/desktop clients 4. JSON/REST Web Services Building Windows VCL applications clearly remains an important focus for the largest majority of our customers, with over 90% of the survey respondents indicating VCL is relevant to their work. Developers Revenues Tied to the use of RAD Studio There is clearly a very varied group of developers using Delphi, C++Builder and RAD Studio, and one way to highlight it is to look at the revenues from using our products developers declared in the survey (and we hope they were honest!). From a 25% of customers not making any money or making less than 1,000 dollars a year, to a few claiming businesses over 100 million dollars! Other Programming Languages Used Besides Delphi and C++ languages, most of the developers using RAD Studio use other development tools and programming languages alongside. Among the other popular languages, this year JavaScript surpassed C#. This is the list from most to least popular: 1. JavaScript 2. C# 3. PHP 4. C 5. Java 6. Python 7. VB 8. VB.NET 9. Objective-C Of course, most of these languages are used with other IDE and editors, the two most popular being: 1. Visual Studio 2. Notepad++ Target Desktop and Mobile OSes Among the operating systems RAD Studio developers build software for, we have two separa[...]



Delphi Blogs of the Week #54

2017-07-21T15:00:50.436Z

A new round up of news, after my two weeks of vacation around Europe.

A new round up of Delphi-related news, after my two weeks of vacation around Europe.

Delphi Product Blogs and More

Quickly find add-ons with new GetIt categories by Sarina at https://community.embarcadero.com/blogs/entry/quickly-find-add-ons-with-new-getit-categories (by the way, we are open for ideas and suggestions, given the system is now fairly flexible)

The Enterprise Connector Beta has started by Sarina at https://community.embarcadero.com/blogs/entry/the-enterprise-connector-beta-has-started

Viewing Salesforce Data in RAD Studio Data Explorer by Sarina at https://community.embarcadero.com/article/16541-viewing-salesforce-data-in-rad-studio-data-explorer

#FireMonkey RAD Studio Overview Download Link: http://forms.embarcadero.com/sFireMonkeyRADStudioOverview

Targeting Chrome OS with Delphi via Android and Linux by Jim McKeeth at https://community.embarcadero.com/blogs/entry/targeting-chrome-os-with-delphi-via-android-and-linux

Notable Blog Posts

Send an Email with an Attachment in iOS, Android, and Windows using RAD Studio by Roy Woll at https://www.woll2woll.com/single-post/2017/04/24/Send-an-Email-with-an-Attachment-FireMonkey

ScannerMApp: a QR/barcode scanner app with Delphi, ZXing and TFrameStand by Andrewa Magni at https://blog.andreamagni.eu/2017/06/scannermapp-a-qrbarcode-scanner-app-with-delphi-zxing-and-tframestand/

Using Google Sign-In for Firebase SDK on Android by Allen Drennan at https://blog.grijjy.com/2017/07/20/using-google-sign-in-for-firebase-sdk-on-android/

SIMD Assembly Optimization by Erik van Bilsen at https://blog.grijjy.com/2017/07/10/simd-assembly-optimization/

Building a (real) Linux daemon with Delphi - Part 1 by Paolo Rossi at http://blog.paolorossi.net/2017/07/11/building-a-real-linux-daemon-with-delphi-part-1-2/

4 Years at Embarcadero Technologies by Jim at http://delphi.org/2017/07/4-years-at-embarcadero/

Encode JSON to a FireDAC Memory Table without REST Request by Craig at http://chapmanworld.com/2017/07/07/encode-json-to-a-firedac-memory-table-without-rest-request/

Stay tunes for more news.

(image)



Delphi Blogs of the (Week) Month #53

2017-06-29T11:08:06.231Z

Really becoming more of a monthly post, with a summary of links, recent news, blogs, releases, etc.

Embarcadero News

Embarcadero Partners with CData to Offer Enterprise Connectors (press release at http://www.businesswire.com/news/home/20170621005319/en). You can read more on this blog post from Sarina, https://community.embarcadero.com/blogs/entry/new-enterprise-connectors-for-delphi-and-c-builder-join-the-beta. The beta of the components can be found in GetIt for Tokyo customers (Professional and above), in a new "Connectors" category. You can use them to connect with over 70 different business, enterprise and social web services. Very nicely integrated with FireDAC and the IDE.

A patch for Tokyo focused on Android is available, http://blog.marcocantu.com/blog/2017-june-102-android-patch.html

Books, books!

Cary Jensen has a new FireDAC book out. See the announcement at http://caryjensen.blogspot.it/2017/05/delphi-in-depth-firedac-is-now-available.html and a review by Stephen at https://community.embarcadero.com/blogs/entry/firedac-book-using-interbase.

Dalija has a new book project focused on Delphi Memory Management, as you can read at https://plus.google.com/u/0/+DalijaPrasnikar/posts/Kkund4GXpXv and https://plus.google.com/+DalijaPrasnikar/posts/CbEnZdx6fNY.

Blog Posts

Visualize JSON using TTreeView at https://community.embarcadero.com/blogs/entry/visualize-json-using-ttreeview

New FireDAC Database Status Page at https://community.embarcadero.com/blogs/entry/new-firedac-database-status-page

Using the Google Cloud Platform APIs at http://​https://blog.grijjy.com/2017/01/13/using-the-google-cloud-platform-apis/

FireMonkey and VCL Style Packs from DelphiStyles.com at https://community.embarcadero.com/blogs/entry/fmx-and-vcl-style-packs-from-delphistyles-com

Third Party Tools

MIDAS dropbox library at http://www.midaconverter.com/dropbox.html

PasLibVlc - use VideoLAN player in Delphi at http://prog.olsztyn.pl/paslibvlc/

The Light End

Delphi developers use spaces, right? https://stackoverflow.blog/2017/06/15/developers-use-spaces-make-money-use-tabs/

(image)



RAD Studio 10.2 Patch for Android Released

2017-06-26T09:33:10.608Z

Last week Embarcadero released a patch for Delphi and C++Builder 10.2 Tokyo addressing issues for Android platform support

As Sarina already mentioned in the community site, last week Embarcadero released a second patch for Delphi and C++Builder 10.2 Tokyo. The first patch was focused on tool chain issues, while this new one addresses several issues for Android platform support. Namely, some of the fixes relate with the platform changes in editing (causing problems when using the backspace key) while other address regressions (and performance issues) introduced in 10.2 Tokyo and caused by platform changes in threading support.

You can find a list of open Quality Portal issues the patch addresses in the download page at https://cc.embarcadero.com/item/30781. This patch is available also for trial customers.

The matching source code is available only for registered users at https://cc.embarcadero.com/item/30782. Notice that the source code includes changes that affect multiple platforms, but we haven't released the updated DCU files for those other platforms. In other words, PAS and DCU will most likely be out of synch either with or without the source code patch, depending on the target platform, and you should consider enabling this new source code for Android specific projects or using it as reference only.

We know this is no ideal and this patch is intended as a temporary solution, while we complete and test a full update of the product, including all internal fixes and all platforms.

(image)



Celebrating 22 Exciting Years of Innovation with Delphi

2017-06-22T09:56:53.341Z

Throughout its history, Delphi has been one of the most successful development platforms as it continues to navigate a highly competitive space, maintain its essence as a robust integrative toolset, and serve a large community of passionate developers. A new marketing booklet summarizes today's product vision. Delphi was released over 22 years ago in San Francisco. More than two decades later, the Delphi design philosophy remains steadfastly the same: continual innovation and increasing productivity for developers. Throughout its history, Delphi has been one of the most successful development platforms as it continues to navigate a highly competitive space, maintain its essence as a robust integrative toolset, and serve a large community of passionate developers. Deep investments have been made in the product over the years to migrate Delphi from a Windows-centric product to a multi-device development tool supporting the five most popular operating systems: Windows, macOS, iOS, Android, and Linux. Global Reach Delphi developers can be found in virtually every corner of the world, and this is why a city moniker designates each of the 10.x versions to celebrate the diverse global reach and significant contributions that Delphi is making today. Since VCL has been the best object-oriented library Windows API wrapping for over 20 years, Seattle was chosen first (to honor the city near Microsoft headquarters). Next, the Berlin release acknowledged the strong developer community and partner network presence that Delphi has -- not only in Germany, but throughout all of Europe. Most recently, the Tokyo release recognizes the proud and growing community in Japan. Tokyo Release: Running on Linux Delphi has long had amazing support for multi-tier and server-side development on Windows. The 10.2 Tokyo release extends all of that support to the Linux operating system. This includes support for WebBroker, WebServices, DataSnap, and the new EMS modules for RAD Server. This means that many of your existing RAD Server/Windows server applications will migrate quite easily over to Linux. Only a few changes are necessary in a typical migration, thanks to the cross-platform FireDAC support. FireDAC works on both Windows and Linux to give you unparalleled access to your favorite databases.  There's more. Gather up all of your Apache or IIS modules, your REST backend services, your Windows services, or any other server-side or console application, and easily migrate those app components from Windows to Linux. New features continue to drive strong innovation If you've not taken a close look lately, it's time to reacquaint yourself with the newer release of Delphi and explore some truly amazing features. These are only a few: Live Preview - Let's say that you're designing an app, and you want to see how it looks on an iOS or Android device. As you work in the Form Designer, simply click a button to see your app in the Live Preview feature of Delphi -- in proper scale and clear definition. There's no need to plug in your device, and you can easily and repeatedly preview the app in either device format as you continue your development work. App Tethering - Maybe you've built a desktop app, and you're also building a mobile companion app. How should these apps talk to each other? App tethering makes it very easy to connect any app on any platform to an app on any other platform -- including Mac-to-Windows, Android-to-Mac, iOS-to-Windows, and so on. Parallel Programming Library - High-level, easy usable, and quick parallelization. It's the holy grail, and it's an integral part of Delphi. Desktop Bridge - Need to get your desktop app into the Windows Store? Simply rebuild, since the Windows Store is available as [...]



Pictures from Italian Delphi Day last week

2017-06-19T16:23:29.838Z

Last week I was at a large Italian conference (almost 100 Delphi developers) in my city. Here are a few pictures and comments.

Last week I was at a large Italian conference (with almost 100 Delphi developers attending) in my city. I gave a keynote on the status and future of Delphi, and there were many other sessions given by Italian Delphi developers and some international experts (including Stefan, Dmitry, and Yuriy). See the conference site www.delphiday.it for more information and the program.

I was able to meet and talk with many attendees, several of which I've known for years, but I was also happy to find some very young developers in the audience. Here there are a few pictures (some I took and some shared by Paolo Rossi and Marco Breveglieri on social media):

(image)

(image)

(image)

(image)

(image)

(image)

(image)

Nice conference. Now I have a fairly long break, I'll be back speaking in public after the summer.

(image)