* src/vmcore/statistics.c (size_threadobject, size_lock_hashtable)
[cacao.git] / src / vmcore / statistics.c
1 /* src/vmcore/statistics.c - global varables for statistics
2
3    Copyright (C) 1996-2005, 2006, 2007 R. Grafl, A. Krall, C. Kruegel,
4    C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
5    E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
6    J. Wenninger, Institut f. Computersprachen - TU Wien
7
8    This file is part of CACAO.
9
10    This program is free software; you can redistribute it and/or
11    modify it under the terms of the GNU General Public License as
12    published by the Free Software Foundation; either version 2, or (at
13    your option) any later version.
14
15    This program is distributed in the hope that it will be useful, but
16    WITHOUT ANY WARRANTY; without even the implied warranty of
17    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18    General Public License for more details.
19
20    You should have received a copy of the GNU General Public License
21    along with this program; if not, write to the Free Software
22    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23    02110-1301, USA.
24
25    $Id: statistics.c 7549 2007-03-21 13:27:14Z twisti $
26
27 */
28
29
30 #include "config.h"
31
32 #include <string.h> 
33 #include <sys/time.h>
34 #include <sys/resource.h>
35
36 #include "vm/types.h"
37
38 #include "mm/gc-common.h"
39
40 #include "toolbox/logging.h"
41
42 #include "vm/global.h"
43
44 #include "vm/jit/code.h"
45
46 #include "vmcore/class.h"
47 #include "vmcore/field.h"
48 #include "vmcore/method.h"
49 #include "vmcore/options.h"
50 #include "vmcore/statistics.h"
51
52
53 /* global variables ***********************************************************/
54
55 static s8 loadingtime = 0;              /* accumulated loading time           */
56 static s8 loadingstarttime = 0;
57 static s8 loadingstoptime = 0;
58 static s4 loadingtime_recursion = 0;
59
60 static s8 compilingtime = 0;            /* accumulated compile time           */
61 static s8 compilingstarttime = 0;
62 static s8 compilingstoptime = 0;
63 static s4 compilingtime_recursion = 0;
64
65 s4 codememusage = 0;
66 s4 maxcodememusage = 0;
67
68 s4 memoryusage = 0;
69 s4 maxmemusage = 0;
70
71 s4 maxdumpsize = 0;
72
73 s4 globalallocateddumpsize = 0;
74 s4 globaluseddumpsize = 0;
75
76
77 /* variables for measurements *************************************************/
78
79 s4 size_classinfo      = 0;
80 s4 size_fieldinfo      = 0;
81 s4 size_methodinfo     = 0;
82 s4 size_lineinfo       = 0;
83 s4 size_codeinfo       = 0;
84
85 s4 size_stack_map      = 0;
86 s4 size_string         = 0;
87
88 s4 size_threadobject   = 0;
89 s4 size_lock_hashtable = 0;
90 s4 size_lock_waiter    = 0;
91
92 int count_const_pool_len = 0;
93 int count_classref_len = 0;
94 int count_parsed_desc_len = 0;
95 int count_vftbl_len = 0;
96 int count_all_methods = 0;
97 int count_methods_marked_used = 0;  /* RTA */
98
99 int count_vmcode_len = 0;
100 int count_extable_len = 0;
101 int count_class_loads = 0;
102 int count_class_inits = 0;
103
104 int count_utf_len = 0;                  /* size of utf hash                   */
105 int count_utf_new = 0;                  /* calls of utf_new                   */
106 int count_utf_new_found  = 0;           /* calls of utf_new with fast return  */
107
108 int count_locals_conflicts = 0;         /* register allocator statistics */
109 int count_locals_spilled = 0;
110 int count_locals_register = 0;
111 int count_ss_spilled = 0;
112 int count_ss_register = 0;
113 int count_methods_allocated_by_lsra = 0;
114 int count_mem_move_bb = 0;
115 int count_interface_size = 0;
116 int count_argument_mem_ss = 0;
117 int count_argument_reg_ss = 0;
118 int count_method_in_register = 0;
119 int count_mov_reg_reg = 0;
120 int count_mov_mem_reg = 0;
121 int count_mov_reg_mem = 0;
122 int count_mov_mem_mem = 0;
123
124 int count_jit_calls = 0;
125 int count_methods = 0;
126 int count_spills = 0;
127 int count_spills_read = 0;
128 int count_pcmd_activ = 0;
129 int count_pcmd_drop = 0;
130 int count_pcmd_zero = 0;
131 int count_pcmd_const_store = 0;
132 int count_pcmd_const_alu = 0;
133 int count_pcmd_const_bra = 0;
134 int count_pcmd_load = 0;
135 int count_pcmd_move = 0;
136 int count_load_instruction = 0;
137 int count_pcmd_store = 0;
138 int count_pcmd_store_comb = 0;
139 int count_dup_instruction = 0;
140 int count_pcmd_op = 0;
141 int count_pcmd_mem = 0;
142 int count_pcmd_met = 0;
143 int count_pcmd_bra = 0;
144 int count_pcmd_table = 0;
145 int count_pcmd_return = 0;
146 int count_pcmd_returnx = 0;
147 int count_check_null = 0;
148 int count_check_bound = 0;
149 int count_max_basic_blocks = 0;
150 int count_basic_blocks = 0;
151 int count_javainstr = 0;
152 int count_max_javainstr = 0;
153 int count_javacodesize = 0;
154 int count_javaexcsize = 0;
155 int count_calls = 0;
156 int count_tryblocks = 0;
157 int count_code_len = 0;
158 int count_data_len = 0;
159 int count_cstub_len = 0;
160 int count_nstub_len = 0;
161 int count_max_new_stack = 0;
162 int count_upper_bound_new_stack = 0;
163
164 s4 count_branches_resolved   = 0;
165 s4 count_branches_unresolved = 0;
166
167 u8 count_native_function_calls=0;
168 u8 count_jni_callXmethod_calls=0;
169 u8 count_jni_calls=0;
170
171
172 static int count_block_stack_init[11] = {
173         0, 0, 0, 0, 0, 
174         0, 0, 0, 0, 0, 
175         0
176 };
177 int *count_block_stack = count_block_stack_init;
178 static int count_analyse_iterations_init[5] = {
179         0, 0, 0, 0, 0
180 };
181 int *count_analyse_iterations = count_analyse_iterations_init;
182 static int count_method_bb_distribution_init[9] = {
183         0, 0, 0, 0, 0,
184         0, 0, 0, 0
185 };
186 int *count_method_bb_distribution = count_method_bb_distribution_init;
187 static int count_block_size_distribution_init[18] = {
188         0, 0, 0, 0, 0,
189         0, 0, 0, 0, 0,
190         0, 0, 0, 0, 0,
191         0, 0, 0
192 };
193 int *count_block_size_distribution = count_block_size_distribution_init;
194 static int count_store_length_init[21] = {
195         0, 0, 0, 0, 0,
196         0, 0, 0, 0, 0,
197         0, 0, 0, 0, 0,
198         0, 0, 0, 0, 0,
199         0
200 };
201 int *count_store_length = count_store_length_init;
202 static int count_store_depth_init[11] = {
203         0, 0, 0, 0, 0,
204         0, 0, 0, 0, 0,
205         0
206 };
207 int *count_store_depth = count_store_depth_init;
208
209
210 /* instruction scheduler statistics *******************************************/
211
212 s4 count_schedule_basic_blocks = 0;
213 s4 count_schedule_nodes = 0;
214 s4 count_schedule_leaders = 0;
215 s4 count_schedule_max_leaders = 0;
216 s4 count_schedule_critical_path = 0;
217
218
219 /* nativeinvokation ***********************************************************
220
221    increments the native invokation count by one
222         
223 *******************************************************************************/
224
225 void nativeinvokation(void)
226 {
227         /* XXX do locking here */
228         count_native_function_calls++;
229 }
230
231
232 /* jnicallXmethodinvokation ***************************************************
233
234    increments the jni CallXMethod invokation count by one
235         
236 *******************************************************************************/
237
238 void jnicallXmethodnvokation(void)
239 {
240         /* XXX do locking here */
241         count_jni_callXmethod_calls++;
242 }
243
244
245 /* jniinvokation *************************************************************
246
247    increments the jni overall  invokation count by one
248         
249 *******************************************************************************/
250
251 void jniinvokation(void)
252 {
253         /* XXX do locking here */
254         count_jni_calls++;
255 }
256
257
258 /* getcputime *********************************** ******************************
259
260    Returns the used CPU time in microseconds
261         
262 *******************************************************************************/
263
264 s8 getcputime(void)
265 {
266         struct rusage ru;
267         int sec, usec;
268
269         getrusage(RUSAGE_SELF, &ru);
270         sec = ru.ru_utime.tv_sec + ru.ru_stime.tv_sec;
271         usec = ru.ru_utime.tv_usec + ru.ru_stime.tv_usec;
272
273         return sec * 1000000 + usec;
274 }
275
276
277 /* loadingtime_stop ************************************************************
278
279    XXX
280
281 *******************************************************************************/
282
283 void loadingtime_start(void)
284 {
285         loadingtime_recursion++;
286
287         if (loadingtime_recursion == 1)
288                 loadingstarttime = getcputime();
289 }
290
291
292 /* loadingtime_stop ************************************************************
293
294    XXX
295
296 *******************************************************************************/
297
298 void loadingtime_stop(void)
299 {
300         if (loadingtime_recursion == 1) {
301                 loadingstoptime = getcputime();
302                 loadingtime += (loadingstoptime - loadingstarttime);
303         }
304
305         loadingtime_recursion--;
306 }
307
308
309 /* compilingtime_stop **********************************************************
310
311    XXX
312
313 *******************************************************************************/
314
315 void compilingtime_start(void)
316 {
317         compilingtime_recursion++;
318
319         if (compilingtime_recursion == 1)
320                 compilingstarttime = getcputime();
321 }
322
323
324 /* compilingtime_stop **********************************************************
325
326    XXX
327
328 *******************************************************************************/
329
330 void compilingtime_stop(void)
331 {
332         if (compilingtime_recursion == 1) {
333                 compilingstoptime = getcputime();
334                 compilingtime += (compilingstoptime - compilingstarttime);
335         }
336
337         compilingtime_recursion--;
338 }
339
340
341 /* print_times *****************************************************************
342
343    Prints a summary of CPU time usage.
344
345 *******************************************************************************/
346
347 void print_times(void)
348 {
349         s8 totaltime;
350         s8 runtime;
351
352         totaltime = getcputime();
353         runtime = totaltime - loadingtime - compilingtime;
354
355 #if SIZEOF_VOID_P == 8
356         dolog("Time for loading classes: %6ld ms", loadingtime / 1000);
357         dolog("Time for compiling code:  %6ld ms", compilingtime / 1000);
358         dolog("Time for running program: %6ld ms", runtime / 1000);
359         dolog("Total time:               %6ld ms", totaltime / 1000);
360 #else
361         dolog("Time for loading classes: %6lld ms", loadingtime / 1000);
362         dolog("Time for compiling code:  %6lld ms", compilingtime / 1000);
363         dolog("Time for running program: %6lld ms", runtime / 1000);
364         dolog("Total time:               %6lld ms", totaltime / 1000);
365 #endif
366 }
367
368
369 /* print_stats *****************************************************************
370
371    outputs detailed compiler statistics
372
373 *******************************************************************************/
374
375 void print_stats(void)
376 {
377         s4    i;
378         float f;
379         s4    sum;
380
381
382         dolog("Number of JIT compiler calls: %6d", count_jit_calls);
383         dolog("Number of compiled methods:   %6d", count_methods);
384
385         dolog("Number of compiled basic blocks:               %6d",
386                   count_basic_blocks);
387         dolog("Number of max. basic blocks per method:        %6d",
388                   count_max_basic_blocks);
389
390         dolog("Number of compiled JavaVM instructions:        %6d",
391                   count_javainstr);
392         dolog("Number of max. JavaVM instructions per method: %6d",
393                   count_max_javainstr);
394         dolog("Size of compiled JavaVM instructions:          %6d(%d)",
395                   count_javacodesize, count_javacodesize - count_methods * 18);
396
397         dolog("Size of compiled Exception Tables:      %d", count_javaexcsize);
398         dolog("Number of Machine-Instructions: %d", count_code_len >> 2);
399         dolog("Number of Spills (write to memory): %d", count_spills);
400         dolog("Number of Spills (read from memory): %d", count_spills_read);
401         dolog("Number of Activ    Pseudocommands: %6d", count_pcmd_activ);
402         dolog("Number of Drop     Pseudocommands: %6d", count_pcmd_drop);
403         dolog("Number of Const    Pseudocommands: %6d (zero:%5d)",
404                   count_pcmd_load, count_pcmd_zero);
405         dolog("Number of ConstAlu Pseudocommands: %6d (cmp: %5d, store:%5d)",
406                   count_pcmd_const_alu, count_pcmd_const_bra, count_pcmd_const_store);
407         dolog("Number of Move     Pseudocommands: %6d", count_pcmd_move);
408         dolog("Number of Load     Pseudocommands: %6d", count_load_instruction);
409         dolog("Number of Store    Pseudocommands: %6d (combined: %5d)",
410                   count_pcmd_store, count_pcmd_store - count_pcmd_store_comb);
411         dolog("Number of OP       Pseudocommands: %6d", count_pcmd_op);
412         dolog("Number of DUP      Pseudocommands: %6d", count_dup_instruction);
413         dolog("Number of Mem      Pseudocommands: %6d", count_pcmd_mem);
414         dolog("Number of Method   Pseudocommands: %6d", count_pcmd_met);
415         dolog("Number of Branch   Pseudocommands: %6d (rets:%5d, Xrets: %5d)",
416                   count_pcmd_bra, count_pcmd_return, count_pcmd_returnx);
417         log_println("                resolved branches: %6d", count_branches_resolved);
418         log_println("              unresolved branches: %6d", count_branches_unresolved);
419         dolog("Number of Table    Pseudocommands: %6d", count_pcmd_table);
420         dolog("Number of Useful   Pseudocommands: %6d", count_pcmd_table +
421                   count_pcmd_bra + count_pcmd_load + count_pcmd_mem + count_pcmd_op);
422         dolog("Number of Null Pointer Checks:     %6d", count_check_null);
423         dolog("Number of Array Bound Checks:      %6d", count_check_bound);
424         dolog("Number of Try-Blocks: %d", count_tryblocks);
425         dolog("Maximal count of stack elements:   %d", count_max_new_stack);
426         dolog("Upper bound of max stack elements: %d", count_upper_bound_new_stack);
427         dolog("Distribution of stack sizes at block boundary");
428         dolog("     0     1     2     3     4     5     6     7     8     9  >=10");
429         dolog("%6d%6d%6d%6d%6d%6d%6d%6d%6d%6d%6d",
430                   count_block_stack[0], count_block_stack[1], count_block_stack[2],
431                   count_block_stack[3], count_block_stack[4], count_block_stack[5],
432                   count_block_stack[6], count_block_stack[7], count_block_stack[8],
433                   count_block_stack[9], count_block_stack[10]);
434         dolog("Distribution of store stack depth");
435         dolog("     0     1     2     3     4     5     6     7     8     9  >=10");
436         dolog("%6d%6d%6d%6d%6d%6d%6d%6d%6d%6d%6d",
437                   count_store_depth[0], count_store_depth[1], count_store_depth[2],
438                   count_store_depth[3], count_store_depth[4], count_store_depth[5],
439                   count_store_depth[6], count_store_depth[7], count_store_depth[8],
440                   count_store_depth[9], count_store_depth[10]);
441         dolog("Distribution of store creator chains first part");
442         dolog("     0     1     2     3     4     5     6     7     8     9");
443         dolog("%6d%6d%6d%6d%6d%6d%6d%6d%6d%6d",
444                   count_store_length[0], count_store_length[1], count_store_length[2],
445                   count_store_length[3], count_store_length[4], count_store_length[5],
446                   count_store_length[6], count_store_length[7], count_store_length[8],
447                   count_store_length[9]);
448         dolog("Distribution of store creator chains second part");
449         dolog("    10    11    12    13    14    15    16    17    18    19  >=20");
450         dolog("%6d%6d%6d%6d%6d%6d%6d%6d%6d%6d%6d",
451                   count_store_length[10], count_store_length[11],
452                   count_store_length[12], count_store_length[13],
453                   count_store_length[14], count_store_length[15],
454                   count_store_length[16], count_store_length[17],
455                   count_store_length[18], count_store_length[19],
456                   count_store_length[20]);
457         dolog("Distribution of analysis iterations");
458         dolog("     1     2     3     4   >=5");
459         dolog("%6d%6d%6d%6d%6d",
460                   count_analyse_iterations[0], count_analyse_iterations[1],
461                   count_analyse_iterations[2], count_analyse_iterations[3],
462                   count_analyse_iterations[4]);
463
464
465         /* Distribution of basic blocks per method ********************************/
466
467         log_println("Distribution of basic blocks per method:");
468         log_println("   <=5  <=10  <=15  <=20  <=30  <=40  <=50  <=75   >75");
469
470         log_start();
471         for (i = 0; i <= 8; i++)
472                 log_print("%6d", count_method_bb_distribution[i]);
473         log_finish();
474
475         /* print ratio */
476
477         f = (float) count_methods;
478
479         log_start();
480         for (i = 0; i <= 8; i++)
481                 log_print("%6.2f", (float) count_method_bb_distribution[i] / f);
482         log_finish();
483
484         /* print cumulated ratio */
485
486         log_start();
487         for (i = 0, sum = 0; i <= 8; i++) {
488                 sum += count_method_bb_distribution[i];
489                 log_print("%6.2f", (float) sum / f);
490         }
491         log_finish();
492
493
494         /* Distribution of basic block sizes **************************************/
495
496         log_println("Distribution of basic block sizes:");
497         log_println("     0     1     2     3     4     5     6     7     8     9   <13   <15   <17   <19   <21   <26   <31   >30");
498
499         /* print block sizes */
500
501         log_start();
502         for (i = 0; i <= 17; i++)
503                 log_print("%6d", count_block_size_distribution[i]);
504         log_finish();
505
506         /* print ratio */
507
508         f = (float) count_basic_blocks;
509
510         log_start();
511         for (i = 0; i <= 17; i++)
512                 log_print("%6.2f", (float) count_block_size_distribution[i] / f);
513         log_finish();
514
515         /* print cumulated ratio */
516
517         log_start();
518         for (i = 0, sum = 0; i <= 17; i++) {
519                 sum += count_block_size_distribution[i];
520                 log_print("%6.2f", (float) sum / f);
521         }
522         log_finish();
523
524         statistics_print_memory_usage();
525
526         dolog("Number of class loads:    %6d", count_class_loads);
527         dolog("Number of class inits:    %6d", count_class_inits);
528         dolog("Number of loaded Methods: %6d\n", count_all_methods);
529
530         dolog("Calls of utf_new:                 %6d", count_utf_new);
531         dolog("Calls of utf_new (element found): %6d\n", count_utf_new_found);
532
533
534         /* LSRA statistics ********************************************************/
535
536         dolog("Moves reg -> reg:     %6d", count_mov_reg_reg);
537         dolog("Moves mem -> reg:     %6d", count_mov_mem_reg);
538         dolog("Moves reg -> mem:     %6d", count_mov_reg_mem);
539         dolog("Moves mem -> mem:     %6d", count_mov_mem_mem);
540
541         dolog("Methods allocated by LSRA:         %6d",
542                   count_methods_allocated_by_lsra);
543         dolog("Conflicts between local Variables: %6d", count_locals_conflicts);
544         dolog("Local Variables held in Memory:    %6d", count_locals_spilled);
545         dolog("Local Variables held in Registers: %6d", count_locals_register);
546         dolog("Stackslots held in Memory:         %6d", count_ss_spilled);
547         dolog("Stackslots held in Registers:      %6d", count_ss_register);
548         dolog("Memory moves at BB Boundaries:     %6d", count_mem_move_bb);
549         dolog("Number of interface slots:         %6d\n", count_interface_size);
550         dolog("Number of Argument stack slots in register:  %6d",
551                   count_argument_reg_ss);
552         dolog("Number of Argument stack slots in memory:    %6d\n",
553                   count_argument_mem_ss);
554         dolog("Number of Methods kept in registers:         %6d\n",
555                   count_method_in_register);
556
557
558         /* instruction scheduler statistics ***************************************/
559
560 #if defined(USE_SCHEDULER)
561         dolog("Instruction scheduler statistics:");
562         dolog("Number of basic blocks:       %7d", count_schedule_basic_blocks);
563         dolog("Number of nodes:              %7d", count_schedule_nodes);
564         dolog("Number of leaders nodes:      %7d", count_schedule_leaders);
565         dolog("Number of max. leaders nodes: %7d", count_schedule_max_leaders);
566         dolog("Length of critical path:      %7d\n", count_schedule_critical_path);
567 #endif
568
569
570         /* call statistics ********************************************************/
571
572         dolog("Function call statistics:");
573         dolog("Number of native function invokations:           %ld",
574                   count_native_function_calls);
575         dolog("Number of jni->CallXMethod function invokations: %ld",
576                   count_jni_callXmethod_calls);
577         dolog("Overall number of jni invokations:               %ld",
578                   count_jni_calls);
579
580
581         /* now print other statistics ********************************************/
582
583 #if defined(ENABLE_INTRP)
584         print_dynamic_super_statistics();
585 #endif
586 }
587
588
589 /* statistics_print_memory_usage ***********************************************
590
591    Print current memory usage.
592
593 *******************************************************************************/
594
595 void statistics_print_memory_usage(void)
596 {
597         s4 sum;
598
599         printf("memory usage ----------------------\n\n");
600         printf("code:                   %10d\n", count_code_len);
601         printf("data:                   %10d\n", count_data_len);
602
603         printf("                         ----------\n");
604
605         sum =
606                 count_code_len +
607                 count_data_len;
608
609         printf("                        %10d\n", sum);
610         printf("\n");
611
612         printf("classinfo  (%3d B):     %10d\n", sizeof(classinfo), size_classinfo);
613         printf("fieldinfo  (%3d B):     %10d\n", sizeof(fieldinfo), size_fieldinfo);
614         printf("methodinfo (%3d B):     %10d\n", sizeof(methodinfo), size_methodinfo);
615         printf("lineinfo   (%3d B):     %10d\n", sizeof(lineinfo), size_lineinfo);
616         printf("codeinfo   (%3d B):     %10d\n", sizeof(codeinfo), size_codeinfo);
617         printf("                         ----------\n");
618
619         sum =
620                 size_classinfo +
621                 size_fieldinfo +
622                 size_methodinfo +
623                 size_lineinfo +
624                 size_codeinfo;
625
626         printf("                        %10d\n", sum);
627         printf("\n");
628
629         printf("constant pool:          %10d\n", count_const_pool_len);
630         printf("classref:               %10d\n", count_classref_len);
631         printf("parsed descriptors:     %10d\n", count_parsed_desc_len);
632         printf("vftbl:                  %10d\n", count_vftbl_len);
633         printf("compiler stubs:         %10d\n", count_cstub_len);
634         printf("native stubs:           %10d\n", count_nstub_len);
635         printf("utf:                    %10d\n", count_utf_len);
636         printf("vmcode:                 %10d\n", count_vmcode_len);
637         printf("exception tables:       %10d\n", count_extable_len);
638         printf("stack map:              %10d\n", size_stack_map);
639         printf("string:                 %10d\n", size_string);
640         printf("threadobject:           %10d\n", size_threadobject);
641         printf("lock hashtable:         %10d\n", size_lock_hashtable);
642         printf("lock waiter:            %10d\n", size_lock_waiter);
643         printf("                         ----------\n");
644
645         sum =
646                 count_const_pool_len +
647                 count_classref_len +
648                 count_parsed_desc_len + 
649                 count_vftbl_len +
650                 count_cstub_len +
651                 count_nstub_len +
652                 count_utf_len +
653                 count_vmcode_len +
654                 count_extable_len +
655                 size_stack_map +
656                 size_string +
657                 size_threadobject +
658                 size_lock_hashtable +
659                 size_lock_waiter;
660
661         printf("                        %10d\n", sum);
662         printf("\n");
663
664         printf("max. memory usage:      %10d\n", maxcodememusage);
665         printf("max. heap memory usage: %10d\n", maxmemusage);
666         printf("max. dump memory usage: %10d\n", maxdumpsize);
667         printf("\n");
668                    
669         printf("heap memory not freed:  %10d\n", (s4) memoryusage);
670         printf("dump memory not freed:  %10d\n", (s4) globalallocateddumpsize);
671         printf("\n");
672 }
673
674
675 /* statistics_print_gc_memory_usage ********************************************
676
677    Print current GC memory usage.
678
679 *******************************************************************************/
680
681 void statistics_print_gc_memory_usage(void)
682 {
683         log_println("GC memory usage -------------------");
684         log_println("");
685         log_println("max. heap size: %10lld", gc_get_max_heap_size());
686         log_println("");
687         log_println("heap size:      %10lld", gc_get_heap_size());
688         log_println("free:           %10lld", gc_get_free_bytes());
689         log_println("used:           %10lld", gc_get_total_bytes());
690 }
691
692
693 /*
694  * These are local overrides for various environment variables in Emacs.
695  * Please do not remove this and leave it at the end of the file, where
696  * Emacs will automagically detect them.
697  * ---------------------------------------------------------------------
698  * Local variables:
699  * mode: c
700  * indent-tabs-mode: t
701  * c-basic-offset: 4
702  * tab-width: 4
703  * End:
704  * vim:noexpandtab:sw=4:ts=4:
705  */