Optimization ve Monitoring için VisualVMVisualVM for Optimization and Monitoring

This page is part of an incremental translation project. Body text not yet translated to Turkish falls back to English even in TR mode.

Profiling Tool'larıProfiling Tools

Profiling tool, yazılımın hangi component'lerinin en fazla resource tükettiği, hangi function'ların en uzun süre çalıştığı ve hangi process'lerin darboğazlara neden olduğu gibi yazılım component'leri hakkındaki resource sorunlarını belirlemek için kullanılan bir optimization tool'udur.A profiling tool is an optimization tool which is used to determine resource problems about components of the sofware such as which components of software consume the most resources, which functions run the longest, and which processes cause bottlenecks.

Profiling tool'ları öncelikle performance analysis ve memory management'a odaklanır, çünkü yazılım sistemlerindeki birincil darboğaz kaynakları CPU ve memory'dir. Bu yüzden genel olarak profiling tool'ları genellikle disk veya network gibi kaynaklara odaklanmaz.Profiling tools focus primarily on performance analysis and memory management, because the primary bottleneck resources in a software systems are the CPU and memory. So in generalprofiling tools generally do not focus on resources such as disk or network.

Performance ve memory analysis, çeşitli hataları tespit edip çözmek veya code'un processor ve memory kullanımı açısından sorunlu kısımlarını optimize etmek için gerçekleştirilir. Tüm profiling tool'ları bu amaçlar için çalışır, ancak programlama dilinin veya platformun özelliklerine ve ihtiyaçlarına göre farklılık gösterirler.Performance and memory analysis are performed to detect and resolve various errors or to optimize problematic parts of the code in terms of processor and memory usage. All profiling tools work for these purposes, however, they vary according to the characteristics and needs of the programming language or platform.

Performance (CPU) AnalysisPerformance (CPU) Analysis

Performance analysis, application içindeki function'ların tetiklenme sırası, tetiklenme sayısı ve bu function'larda geçirilen süre gibi çalışma süresine dayalı tüm analysis sürecidir. Application'ın hızını ölçer ve processing yükü açısından verimliliğini belirler.Performance analysis is the whole analysis process based on the running time, such as the triggering order of functions within the application, the number of triggers, and the time spent in these functions. It measures the speed of the application and determine its efficiency in terms of processing load.

Memory AnalysisMemory Analaysis

Memory Analysis, application'ın memory kullanımını ölçmek, memory'de tutulan data'yı incelemek ve gereksiz memory kullanımını veya memory leak'lerini tespit etmek için gerçekleştirilen analysis sürecidir.Memory Analysis is the analysis process carried out to measure the memory usage of the application, examine the data held in memory, and detect unnecessary memory usage or memory leaks.

VisualVM Nedir?What is VisualVM?

Java application'ları, Java programları için platform bağımsız bir runtime environment sağlayan "Java Virtual Machine" (JVM) adlı bir virtual machine üzerinde çalışır. Üzerinde çalışan application'ları analiz etmek ve kullanmak için birçok tool sağlar.Java applications run on a virtual machine called the “Java Virtual Machine” (JVM), which provides a platform-independent runtime environment for Java programs. It provides many tools for analyzing and using applications running on it.

VisualVM, JVM üzerinde çalışan application'ları izlemek ve analiz etmek için kullanılan bir profiling tool'udur. Yapısal olarak, JVM tarafından sunulan tüm profiling tool'larıyla kullanıcı dostu bir interface sunar. Monitoring açısından bazı sınırlı feature'lar sunduğundan, gerektiğinde bir monitoring tool'u olarak da kullanılabilir.VisualVM is a profiling tool used to monitor and analyze applications running on the JVM. Structurally, it offers a user-friendly interface with all the profiling tools offered by the JVM. Since it offers some limited features in terms of monitoring, it can also be used as a monitoring tool when needed.

VisualVM'in Ana İşlevleriMain Functionalities of VisualVM

VisualVM'de aşağıdaki operation'ları gerçekleştirmek mümkündür:It is possible to perform the following operations on VisualVM:

Alternatif Tool'larAlternative Tools

VisualVM'e alternatif olarak, YourKit en yaygın ve profesyonel seçeneklerden biridir. JProfiler veya Java Mission Control gibi diğer çözümler de alternatif olarak düşünülebilir.As an alternative to VisualVM, YourKit is one of the most common and professional options. Other solutions such as JProfiler or Java Mission Control can also be considered as alternatives.

VisualVM Nasıl Çalıştırılır?How to run VisualVM?

Önce, VisualVM'i https://visualvm.github.io/ adresinden indirmelisiniz. İndirdiğiniz sıkıştırılmış folder'ı açtıktan sonra, bu folder'daki bin\visualvm.exe dosyasını çalıştırabilirsiniz. Diğer operating system'ler için, sisteminizin yapısına göre gerekli talimatları takip etmeniz gerekir.First, you should download VisualVM from https://visualvm.github.io/. After opening the compressed folder you downloaded, you can run the binvisalvm.exe file in this folder. For other operating systems, you need to follow the necessary instructions according to the structure of your system.

Analysis'in amacına bağlı olarak, VisualVM'i başlatırken memory parametrelerini ve VisualVM'in çalışacağı JDK path'ini configure etmek gerekebilir. Bunu yapmak için, ihtiyaçlarınıza göre \etc\visualvm.conf dosyasındaki ilgili parametreleri düzenlemelisiniz. Bu configuration dosyasındaki en önemli parametreler visualvm_default_options ve visualvm_jdkhome'dur. Diğer parametreler için lütfen VisualVM dokümantasyonuna bakınız.Depending on the purpose of the analysis, when starting VisualVM, it may be necessary to configure the memory parameters and the JDK path where VisualVM will run. To do this, you should edit the relevant parameters in the \etc\visualvm.conf file according to your needs. The most important parameters in this configuration file are visualvm_default_options and visualvm_jdkhome. For other parameters, please refer to the VisualVM documentation.

TROIA screenshot

Aynı amaç için, configuration dosyasını değiştirmeden VisualVM'i çalıştırırken application'a -J<jvm_option> ve –jdkhome parametrelerini de girebilirsiniz. Ayrıca, VisualVM command line tool'larıyla interface üzerinden birçok operation gerçekleştirilebilir ve böylece process'ler otomatize edilebilir. VisualVM application'ının bulunduğu folder'da visualvm –help komutunu çalıştırarak diğer VisualVM parametrelerini inceleyebilirsiniz.For the same purpose you can also enter -J<jvm_option> and –jdkhome parameters to the application while running VisualVM without changing the configuration file. Further, many operations can be performed via the interface with the VisualVM command line tools, and thus processes can be automated. You can examine the other VisualVM parameters by running the visualvm –help command in the folder where the VisualVM application is located.

Application çalışırken görünen ekranın iki temel component'i vardır. Bunlardan ilki, çalışan JVM'leri, snapshot'ları veya heapdump'ları gösteren sol bölümdür. Diğeri, bağlı JVM'in durumunu veya bu JVM üzerinde gerçekleştirilecek operation'ları gösteren ikinci bölümdür. Application ilk açıldığında, henüz bağlı bir JVM olmadığından splash screen veya boş bir ekran görünecektir.The screen that appears when the application is running has two basic components. The first of these is the left section, which shows the running JVMs, snapshots or heapdumps. The other is the second section, which shows the status of the connected JVM or the operations to be performed on this JVM. When the application is first opened, the splash screen or a blank screen will appear because there is no connected JVM yet.

TROIA screenshot

VisualVM üzerinden uzak (remote) bir JVM'e bağlanmak da mümkündür. Bu dokümanda, yalnızca local olarak çalışan bir JVM üzerinde çalışmaya odaklanacağız.It is also possible to connect to a remote JVM via VisualVM. In this document, we will focus only on operating on a locally running JVM.

İncelenecek JVM'e Nasıl Bağlanılır?How to connect to the JVM to be examined?

Application'ınızı analiz etmek için, önce VisualVM üzerinden bir JVM'e bağlanmalısınız. Bunu yapmak için, VisualVM'in sol tarafındaki local JVM'lerden analiz etmek istediğiniz application'ı seçip çift tıklamanız gerekir.In order to analyze your application, you must first connect to a JVM via VisualVM. To do this, you need to double-click on the application you want to analyze by selecting it from the local JVMs on the first left side of VisualVM.

Aynı application'ın birden fazla instance'ı operating system'de çalışıyorsa, doğru JVM'e bağlandığınızdan emin olmalısınız. Bunu yapmak için, application'ınızın ismini veya process ID'sini (pid) bilmeniz gerekir. Bunu task manager'da bulabilirsiniz. Task manager'da application'ınızın PID'sini göremiyorsanız, bu column'u da görünür hale getirip bu data'ya erişebilirsiniz.If multiple instances of the same application are running on the operating system, you must ensure that you are connecting to the correct JVM. To do this, you need to know the name or process ID (pid) of your application. You can find this in the task manager. If you cannot see the PID of your application in the task manager, you can also make this column visible and access this data.

TROIA screenshot

Doğru JVM instance'ına bağlandıktan sonra, sağ tarafta o JVM için temel bilgi sağlayan bir ekran açılır. Buradaki data'da, java home, JVM version, JVM argument'ları ve System property'leri gibi sistemi bir bütün olarak etkileyecek configuration'ı görmek mümkündür.After connecting to the correct JVM instance, a screen opens on the right side that provides basic information for that JVM. In the data here, it is possible to see the configuration that will affect the system as a whole, such as java home, JVM version, JVM arguments and System properties.

TROIA screenshot

Kritik -Xms ve -Xmx parametreleri de burada JVM Parameters içinde listelenir. Bu ekran, tüm kritik parametrelerin planlandığı gibi JVM'e yansıyıp yansımadığını kontrol etmek için kullanılabilir.The critical -Xms and -Xmx parameters are also listed here within the JVM Parameters. This screen can be used to check whether all critical parameters are reflected in the JVM as planned.

CPU ve Memory Kullanımı Nasıl İzlenir?How to monitor CPU and Memory Usage?

JVM'e bağlandıktan sonra, Overview'dan Monitor tab'ına geçerseniz, bağlı JVM hakkında bazı cpu ve memory bilgilerini izleyebilirsiniz. Bu tab'da, JVM uptime, CPU ve memory tüketimi gibi grafiksel interface'ler aracılığıyla anlık olarak bazı basit ve faydalı bilgiler vardır. Bu ekranda, o anda sistemdeki thread sayısını ve yüklenen class sayısını grafiksel olarak izlemek de mümkündür.After connecting to the JVM, if you switch from Overview to the Monitor tab, you can monitor some cpu and memory info about connected JVM. There are some simple and useful information on this tab such as JVM uptime, CPU and memory consumption instantly via graphical interfaces. In this screen, it is also possible to graphically monitor the number of threads and the number of loaded classes in the system at that moment.

TROIA screenshot

Ayrıca, Monitor tab'ında Garbage Collector'ı tetikleyerek, memory'de kullanılmayan class instance'ları memory'den temizlenebilir. Bu süreç, normal koşullar altında JVM tarafından gerçekleştirilen bir operation'dır. Ancak, bir process için geçici olarak kullanılan ama daha sonra release edilmesi beklenen durumlar analiz edilirken, Garbage Collector'ın manuel olarak çalıştırılması gerekebilir. Başka bir deyişle, bu tool olası memory leak sorunlarını araştırırken kullanılabilir.Additionly, by triggering the Garbage Collector on the Monitor tab, unused class instances that are in memory can be cleared from memory. This process is an operation carried out by the JVM under normal conditions. However, when analyzing situations that are temporarily used for a process but are expected to be released later on the application, the Garbage Collector may need to be run manually. In other words, this tool can be used when investigating possible memory leak problems.

HeapDump Nedir?What is HeapDump?

Monitor tab'ı üzerinden yapılabilecek operation'lardan biri Heap Dump almaktır. Heap, bir application'a çalışması sırasında ayrılan ve application tarafından dinamik olarak kullanılan memory alanıdır. Heap Dump butonuna basıldığında, heap memory alanındaki tüm class'lar ve içerikleri bir dosyaya yazılır. Bu data, şu anda memory'de olan hemen hemen her şeyi içerir ve hedefe göre bu data üzerinde çeşitli analysis'ler yapılabilir.One of the operations that can be done via the Monitor tab is to take a Heap Dump. Heap is the memory area allocated to an application during its operation and used dynamically by the application. When the Heap Dump button is pressed, all classes and their contents in the heap memory area are written to a file. This data includes almost everything currently in memory, and various analyses can be conducted on this data according to the target.

Bir heap dump oluşturduğunuzda, bu heap dump, bağlı olduğunuz server'ın altında zaman bilgisiyle görünür. Çift tıklayıp açtığınızda, sistem önce heap dump alındığı anda memory ve application hakkında toplanan data'nın bir özetini açar.When you create a heap dump, this heap dump appears with the time information under the server you are connected to. When you double-click it and open it, system firstly opens a summary of the data collected about the memory and application at the time the heap dump was taken.

TROIA screenshot

Bu özet ekranında, "objects" seçeneğini seçerseniz, şu anda memory'de olan tüm object'lerin bir listesini görebilirsiniz. Bu Objects ekranında, memory'de en fazla alan kullanan object'leri veya tüm object'leri görüntüleyebilirsiniz. Sayfanın altındaki filtreleri kullanarak, sonuçlar class veya package ismine göre filtrelenebilir.On this summary screen, if you select the “objects” option, you can see a list of all objects currently in memory. On this Objects screen, you can view the objects that use the most space in memory or all objects. Using the filters at the bottom of the page, the results can be filtered based on class or package name.

TROIA screenshot

Bu ekranda, object count'unu, tüketilen memory alanını, her sample için object'lerin subfield'larını ve bu object'lerin ve field'larının değerlerini görüntüleyebilirsiniz. Bu bağlamda, canlı bir environment'tan alınan bir heap dump data'sının information security riskleri oluşturduğunu belirtmek önemlidir.On this screen, you can view object count, consumed memory space, subfields of objects for each sample and the values ​​of these objects and their fields. In this context, it is important to note that a heap dump data taken from a live environment poses information security risks.

Heap dump oluşturulup incelendiğinde, "retained size" bilgisinin ilk aşamada hesaplanmadığını fark edeceksiniz. Retained size, bir object'in ve reference'larının, memory heap'indeki diğer object'lerle olan ilişkilerini dikkate alarak kapladığı memory miktarını ifade eder. Başka bir deyişle, bir object memory'den silindiğinde, bu object'e doğrudan veya dolaylı olarak reference veren tüm object'lerin de memory'den silinip silinmeyeceğini belirler.When the heap dump is generated and examined, you will realize that the “retained size” information is not calculated at the first stage. Retained size refers to the amount of memory occupied by an object and its references, considering its relationships with other objects in the memory heap. In other words, when an object is deleted from memory, it determines whether all objects that directly or indirectly reference this object will also be deleted from memory.

TROIA screenshot

"Retained Size"ı hesaplamak uzun ve maliyetli bir süreçtir ve her durumda gerekli olmadığından doğrudan hesaplanmaz. Analysis'inizde bu data'ya ihtiyacınız varsa, bu data'yı heap dump özet seçeneğini kullanarak hesaplayabilir ve ardından objects tab'ına geçerek analysis sürecinize devam edebilirsiniz.Calculating “Retained Size” is a long and costly process and is not calculated directly because it is not needed in every case. If you need this data in your analysis, you can calculate this data using the heap dump summary option and then continue your analysis process by switching to the objects tab.

Farklı zamanlarda alınan farklı heap dump dosyaları arasında karşılaştırmalı analysis yapmak için heap dump dosyalarınızı export edip saklayabilirsiniz.You can export and store your heap dump files to make comparative analysis between different heap dump files taken different times.

ThreadDump Nedir?What is ThreadDump?

Thread, bir programda paralel olarak çalışabilen en küçük execution birimidir. Bir program, birden fazla thread kullanarak aynı anda birden fazla operation gerçekleştirebilir. Thread'ler, bağlı oldukları process'e ayrılan aynı memory alanını paylaşır, bu da data alışverişini daha kolay ve hızlı hale getirir.A thread is the smallest unit of execution that can run in parallel in a program. A program can perform multiple operations simultaneously using multiple threads. Threads share the same memory space allocated to the process they are attached to, making it easier and faster to exchange data.

VisualVM'de bir JVM'e bağlandıktan sonra, application'daki thread'ler ve güncel durumları "Threads" tab'ında izlenebilir. Thread'ler, çalışma durumlarına göre filtrelenerek listelenebilir. Yine bu tab'da, thread dump'ları alınabilir ve JVM'deki thread'ler anlık olarak raporlanabilir. Alınan thread dump'ları bu link altında listelenecektir. Bu dosyalar farklı şekilde kaydedilip daha sonraki karşılaştırmalı analysis'lerde kullanılabilir.After connecting to a JVM on VisualVM, the threads in the application and their current status can be monitored in the “Threads” tab. Threads can be listed by filtering them according to their running status. Again, in this tab, thread dumps can be taken and the threads on the JVM can be reported instantly. The thread dumps taken will be listed under this link. These files can be saved differently and used in comparative analyses later.

TROIA screenshot

Thread dump, bir application'ın güncel çalışma durumunu incelemek için kullanılan data'dır. Özellikle multi-threaded application'larda, thread dump her thread'in belirli bir anda ne yaptığını ve hangi kaynaklara eriştiğini gösterir. Application beklenmedik şekilde donduğunda veya yavaşladığında, developer'lar veya system administrator'lar sorunları belirlemek için bu dump'ı analiz edebilir. Thread dump, thread'in durumu ve o anda çalışan code'un call stack bilgisi gibi önemli bilgiler içerir.Thread dump is the data used to examine the current running state of an application. Especially in multi-threaded applications, thread dump shows what each thread is doing at a time and which resources it is accessing. When the application freezes or slows down unexpectedly, developers or system administrators can analyze this dump to identify problems. The thread dump contains important information such as the state of the thread and the call stack information of the currently executing code.

TROIA Application Server'da, her kullanıcının anlık operation'ları ayrı bir thread olarak çalıştırılır. Bu bağlamda, CANIAS(rmi) ile başlayan thread'ler kullanıcı operation'larıdır ve CANIAS(checker) ile başlayan thread'ler kullanıcı session'larını izlemek için açılan thread'lerdir.On the TROIA Application Server, each user’s instant operations are executed as a separate thread. In this context, threads starting with CANIAS(rmi) are user operations, and threads starting with CANIAS(checker) are threads opened to monitor user sessions.

TROIA screenshot

SamplingSampling

VisualVM'de "CPU Sampling" ve "Memory Sampling" gerçekleştirerek performance veya memory analysis yapmak mümkündür. Bunu yapmak için, VisualVM'in "Sampling" tab'ında belirli bir zaman aralığı için sampling operation'ı açmalısınız. Sampling süreci tamamlandığında, sampling aralığında hangi process'lerin çalıştırıldığını veya şu anda hangi class instance'larının memory'de olduğunu görmek mümkündür.It is possible to perform performance or memory analysis by performing “CPU Sampling” and “Memory Sampling” on VisualVM. To do this, you must open sampling operation for a certain time interval in the “Sampling” tab of VisualVM. When the sampling process is completed, it is possible to see which processes were executed during the sampling interval or which class instances are currently in memory.

TROIA screenshot

Sampling, belirli aralıklarla JVM'den data okunarak yapıldığından, o anda çalışan sisteme nispeten daha az yük ekler. Garbage Collector etkisini izlemek veya memory'deki object sayısını görmek gibi belirli ölçekli analysis'ler için faydalı olabilir, ancak sampling bazı sorunları tespit etmek için yetersiz kalabilir.Sampling adds relatively less load to the currently running system because it is done by reading data from the JVM at certain intervals. It can be useful for certain scale analyses, such as monitoring the Garbage Collector effect or seeing the number of objects in memory, but sampling may be insufficient to detect some problems.

Ayrıca, Sampling tab'ında, değişiklikleri adım adım karşılaştırmak için sampling süreci sırasında bir anda snapshot'lar alabilirsiniz. Bu ekrandan bir heap dump almak, snapshot'ları veya sampling data'sını filtrelemek vb. de mümkündür.Additionally, in the Sampling tab, you can take snapshots at a moment in the sampling process to compare changes step by step. It is also possible to take a heap dump, filter the snapshots or sampling data, etc. from this screen.

TROIA screenshot

Profiling Nasıl Gerçekleştirilir?How to Perform Profiling?

Profiling, application'ı optimize etmek ve olası hataları düzeltmek için gerekli data'yı sağlayarak CPU ve memory kullanımı hakkında daha detaylı ve sürekli data toplar. Sampling süreciyle karşılaştırıldığında, sampling sürecinde belirli aralıklarla data toplanırken, bu data profiling sürecinde sürekli olarak toplanır. Bu yüzden toplanan data, profiling sürecinde daha detaylı ve daha büyüktür.Profiling collects data on CPU and memory usage in more detail and continuously, providing the necessary data for optimizing the application and correcting possible errors. In comparison to the sampling process, while data is collected at certain intervals in the sampling process, this data is collected continuously. Therefore collected data is more detailed and larger in the profiling process.

CPU ProfilingCPU Profiling

VisualVM'de CPU profiling için, ana tab'lardan "Profiling" tab'ına gitmelisiniz. Burada, sağdaki seçenekler arasında, profiling sürecinin konusu olacak class'lar için bir package yazılmalıdır. Bu seçenekle, temel Java library'lerinden ve diğer library'lerden gelen data hariç tutulur.For CPU profiling on VisualVM, you must go to the “Profiling” tab from the main tabs. Here, among the options on the right, a package should be written for the classes that will be the subject of the profiling process. With this option, the data coming from the basic Java libraries and other libraries are exclued.

Profiling sürecini başlatmak için, tab'daki CPU butonuna basmalısınız, ardından data toplama başlar. Profiling süreci başladıktan sonra, data toplamak için profile edilen application'da bazı action'ları tetiklemelisiniz. Configuration'a bağlı olarak, action'lar tetiklendiğinde profiling data'sı birikmeye başlayacaktır.To start the profiling process, you must press the CPU button on the tab, then data collections starts. After the profiling process begins, you must be trigger some actions on the profiled application in order to collect data. Depending on the configuration, profiling data will begin to accumulate once the actions are triggered.

TROIA screenshot

Data toplanırken, süreci geçici olarak duraklatmak veya belirli bir noktaya kadar toplanan data'nın bir snapshot'ını almak, alınan snapshot'ları export etmek veya data'da öne çıkan method'ları filtreleyip plot etmek mümkündür. Çalıştırılan function'larla ilgili data, bu function'ların çalıştığı thread'ler altında listelenir. Profiling sürecini tamamen durdurmak için stop butonuna tıklamalısınız.While data is being collected, it is possible to temporarily pause the process or take a snapshot of the data collected up to a certain point, export the snapshots taken, or filter and plot the methods that stand out in the data. Data related to the functions that are run are listed under the threads that those functions are running on. To completely stop the profiling process, you must click the stop button.

TROIA screenshot

Analiz edilen JVM bir TROIA Application server ise, RMI TCP Connection prefix'iyle başlayan thread'ler, user interaction nedeniyle server'da meydana gelen process'leri çalıştırmak amacıyla oluşturulan thread'lerdir.If the analyzed JVM is a TROIA Application server, threads starting with the RMI TCP Connection prefix are threads created for the purpose of running processes occurring on the server due to user interaction.

CPU Profiling data'sında, "Invocations" column'u ilgili method'un kaç kez çalıştırıldığını gösterir ve Total Time (CPU), gerçek CPU zamanının ölçülen/tahmini değeridir. Total Time, bu method için harcanan toplam süreyi gösterir. Başka bir deyişle, ilgili thread bekleme durumundaysa, CPU tüketmez ve bu süre CPU süresine dahil edilmez. Bu süreler, bu method tarafından çağrılan method'ların süresini içerir. "Self Time", yalnızca bu method tarafından harcanan süreyi gösterir. Bu yüzden çağıran method'un "Self Time"ına, method tarafından çağrılan method'larda geçirilen süre dahil edilmez.In the CPU Profiling data, the “Invocations” column shows how many times the relevant method was executed, and Total Time (CPU) is the measured/estimated value of the real CPU time. Total Time indicates the total time spent for this method. In other words, if the relevant thread is in the waiting state, it does not consume CPU and this time is not included in the CPU time. These periods include the time of the methods called by this method. “Self Time” shows only the time spent by this method. So the time spent in the methods called by the method is not included in the “Self Time” of the calling method.

Profiling sürecinden sonra yapılacak analysis'lerde; metodoloji, sorunun türüne veya yapılacak optimization'ın niteliğine bağlıdır. Bu yüzden, sonuçların nasıl değerlendirileceğini gösteren bir recepie oluşturmak mümkün değildir. Ancak; analysis süreci sırasında dikkate alınması gereken noktalar vardır. Bu tür analysis'lerde, uzun süreli ve büyük ölçekli data ile gerçekleştirilen process'ler büyük miktarda profiling data'sı üretecektir. Ve bu, inceleme sürecini zorlaştırır. Bu yüzden, çözülmesi planlanan sorunun niteliğine göre, sorunu belirleme sürecinde hız ve kaynaklar açısından, analiz edilecek kadar büyük bir alt küme üzerinde analysis yapmak faydalı olacaktır. Analysis süreci sırasında yapılacak karşılaştırmaları, mümkünse aynı sistemde, benzer sistem kaynaklarıyla gerçekleştirmek ve etkili sonuçlar elde etmek için farklı process'leri birbiriyle karşılaştırmamak doğru olacaktır.In the analyses to be made after the profiling process; the methodology depends on the type of the problem or the nature of the optimization to be made. Therefore, it is not possible to create a recepie that shows how to evaluate the results. However; there are points to be considered during the analysis process. In such analyses, processes carried out with long-term and large-scale data will produce a large amount of profiling data. And this makes the examination difficult. Therefore, according to the nature of the problem planned to be solved, performing analysis on a subset of the problem that is large enough to be analyzed will be beneficial in terms of speed and resources in the process of determining the problem. It would be correct to perform the comparisons to be made during the analysis process with similar system resources. If possible, on the same system, and not to compare different processes with each other in order to achieve effective results.

Memory ProfilingMemory Profiling

Memory profiling gerçekleştirmek için, "Profiling" tab'ında memory seçeneği başlatılmalıdır. Başlamadan önce, sağdaki "memory settings" bölümünden memory profiling sürecinin konusu olacak class'lar için sınırlayıcı bir package girmek faydalı olacaktır. TROIA platformu için en temel package com.ias.** olarak girilebilir. Bu package, library'ler hariç tüm class'ların izlendiği anlamına gelir.To perform memory profiling, the memory option must be started in the “Profiling” tab. Before starting, it would be useful to enter a restrictive package for the classes that will be subject to the memory profiling process from the “memory settings” section on the right. The most basic package for the TROIA platform can be entered as com.ias.**. This package means that all classes except libraries are monitored.

TROIA screenshot

Memory Profiling süreci sırasında anlık olarak bir snapshot almak ve bu snapshot'ı export etmek de mümkündür. Memory Profiling sürecinden sonra, profiling operation'ı stop butonuyla durdurulmalıdır.It is also possible to take a snapshot instantly and export this snapshot during the Memory Profiling process. After the Memory Profiling process, the profiling operation should be stopped with the stop button.

Memory profiling'in amacı genellikle sistemin memory tüketimini optimize etmek veya olası memory leak sorunlarını tespit etmektir. Bu bağlamda, profile edilen application'ın memory yapısını, class'lar arası ilişkileri ve bağımlılıkları bilmek, doğru analysis'ler yapmak için faydalı olacaktır. Ayrıca, memory ile ilgili analysis'lerde, normal koşullar altında otomatik olarak tetiklenen Garbage Collector gibi yapıları analysis süreci sırasında dikkatli kullanmak son derece önemlidir. GC olmadan, sistemde görünen bazı object'lerin sayısı olması gerekenden daha yüksek olabilir.The purpose of memory profiling is generally to optimize the memory consumption of the system or to detect possible memory leakage problems. In this context, knowing the profiled application’s memory structure, inter-class relationships and dependencies will be useful for making correct analyses. Additionally, in memory-related analyses, it is extremely important to use structures such as Garbage Collector, which are automatically triggered under normal conditions, carefully during the analysis process. Without GC, the number of some objects in the system that appear may be higher than it should be.

TROIA Platformunda, memory yapısı application server, session ve transaction gibi iç içe block'larda ilerler. Bu yüzden, bir application kapatıldığında, memory'de o application ile ilgili cache bilgisi dışında bir içerik kalmamalıdır.In the TROIA Platform, the memory structure progresses in nested blocks such as application server, session and transaction. Therefore, when an application is closed, there should be no content left in memory other than the cache information related to that application.