infinite loop in wp_query using simple query

I’m not certain why it would cause an infinite loop, but make sure not to use $wp_query as the variable name for your custom query. It’s a reserved global variable for the main query. Use a different name for the variable. I’d also suggest using wp_reset_postdata() after the loop:

$my_query = new WP_Query( $args );

if ( $my_query->have_posts() ) :
    while ( $my_query->have_posts() ) {
        $my_query->the_post();
    }
else:
  echo "nothing found.";
endif;

wp_reset_postdata();