A computer-implemented method for detecting a memory leak in dynamically allocated portions of a main memory of a computer system, the computer system comprising the main memory and a computer processor, the computer-implemented method comprising: starting executing an executable code by the computer processor; repetitively executing at least a portion of the executable code (201, 204), the least a portion of the executable code comprising dynamic memory allocation requests and dynamic memory deallocation requests, wherein a repetition number of the repetitive executions is an integer value greater than one; in response to execution of each of the dynamic memory allocation requests of the at least a portion of the executable code generating a record, each of the records comprising a unique memory identification of a unique portion of the main memory dynamically allocated upon the execution of the each of the dynamic memory allocation requests and a unique code identification of a fragment of the executable code and/or of a fragment of a source code corresponding to the fragment of the executable code, wherein execution of the fragment of the executable code causes the execution of the each of the dynamic memory allocation requests, wherein the executable code is generated from the source code, wherein each of the unique memory identifications comprises a memory size of the respective unique portion of the main memory, wherein each of the unique memory identifications further comprises a memory address of the respective unique portion of the main memory; in response to execution of each of the dynamic memory dealfocation requests of the at least a portion of the executable code deleting one of the records if the one of the records comprises the unique memory identification as specified in the each of the dynamic memory deallocation requests; after completion of the repetitive executing, counting numbers of the records in each of groups of the records, wherein each of the groups consists of the records having the identical unique code identifications and the identical memory sizes (205, 206); selecting the groups having the numbers of the records being equal either to the repetition number or to the repetition number multiplied by any integer number greater than one; and identifying the fragment of the executable code having unique code identification stored in the record of one of the selected groups as a fragment of the executable code which execution causes the memory leak and/or identifying the fragment of the source code having the unique code identification stored in the record of the one of the selected groups as a fragment of the source code having the respective fragment of the executable code which execution causes the memory leak. starting executing an executable code by the computer processor; repetitively executing at least a portion of the executable code (201, 204), the least a portion of the executable code comprising dynamic memory allocation requests and dynamic memory deallocation requests, wherein a repetition number of the repetitive executions is an integer value greater than one; in response to execution of each of the dynamic memory allocation requests of the at least a portion of the executable code generating a record, each of the records comprising a unique memory identification of a unique portion of the main memory dynamically allocated upon the execution of the each of the dynamic memory allocation requests and a unique code identification of a fragment of the executable code and/or of a fragment of a source code corresponding to the fragment of the executable code, wherein execution of the fragment of the executable code causes the execution of the each of the dynamic memory allocation requests, wherein the executable code is generated from the source code, wherein each of the unique memory identifications comprises a memory size of the respective unique portion of the main memory, wherein each of the unique memory identifications further comprises a memory address of the respective unique portion of the main memory; in response to execution of each of the dynamic memory dealfocation requests of the at least a portion of the executable code deleting one of the records if the one of the records comprises the unique memory identification as specified in the each of the dynamic memory deallocation requests; after completion of the repetitive executing, counting numbers of the records in each of groups of the records, wherein each of the groups consists of the records having the identical unique code identifications and the identical memory sizes (205, 206); selecting the groups having the numbers of the records being equal either to the repetition number or to the repetition number multiplied by any integer number greater than one; and identifying the fragment of the executable code having unique code identification stored in the record of one of the selected groups as a fragment of the executable code which execution causes the memory leak and/or identifying the fragment of the source code having the unique code identification stored in the record of the one of the selected groups as a fragment of the source code having the respective fragment of the executable code which execution causes the memory leak.