Clustering is advisable technique for analysis and interpretation of long-term ECG Holter records. As a non-supervised method, several challenges are posed due to factors such as signal length (very long duration), noise presence, dynamic behavior and morphology variability (different patient physiology and/or pathology). This work describes an improved version of the k-means clustering algorithm (J-means) for this task. In order to reduce the number of heartbeats to process, a preclustering stage is also employed. Dissimilarity measure calculation is based on the Dynamic Time Warping approach. To assess the validity of the proposed method, a comparative study is carried out, using k-means, k-medians, hk-means, and J-means. Heartbeat features are extracted by means of WT coefficients and trace segmentation. Best results were achieved by the J-means algorithm, which reduces the clustering error down to 4.5% while the critical error tends to the minimal value.